jiahuimbzuai/CoQuIR huggingface dataset:
//  [typescript]
{
  const run = (input: string) => {
    let numbers = input.trim().split("")

    for (let first = 0; first <= 1; first++) {
      for (let second = 0; second <= 1; second++) {
        for (let third = 0; third <= 1; third++) {
          const o1 = first === 0 ? '+' : '-'
          const o2 = second === 0 ? '+' : '-'
          const o3 = third === 0 ? '+' : '-'

          const result = numbers[0] + o1 + numbers[1] + o2 + numbers[2] + o3 + numbers[3]
          if (eval(result) === 7) {
            return result + '=7'
          }
        }
      }
    }

  }

  const Main = (input: string) => {
    console.log(run(input))
  };

  Main(require("fs").readFileSync("/dev/stdin", "utf8"));
}
//  [python]
n=int(input())
x=[list(map(int,input().split()))for i in range(n)]
#print(x)

for i in range(n-2):
  cnt = 0
  if  x[i][0]==x[i][1]:
    cnt=1
  else:
    continue
    
  if  x[i+1][0]==x[i+1][1]:
    cnt=cnt+1
    
  else:
    continue
    
  if x[i+2][0]==x[i+2][1]:
    cnt=cnt+1 
    if cnt==3:
      print('Yes')
      break
  else:
    break
if cnt!=3:
  print('No')
//  [python]
def input_array():
	return list(map(int,input().split()))
  
n=int(input())
D=[input_array() for i in range(n)]

count=0
for d in D:
	if d[0]==d[1]:
		count+=1
	else:
		count=0

	if count==3:
		break
if count==3:
	print("Yes")
else:
	print("No")
//  [python]
N = int(input())

x = 0
for i in range(N):
    a, b = map(int, input().split())
    if a == b:
        x += 1
    else:
        x = 0

    if x >= 3:
        print("Yes")
        break
else:
    print("No")
//  [python]
from sys import stdin,stdout
def INPUT():return list(int(i) for i in stdin.readline().split())
def inp():return stdin.readline()
def out(x):return stdout.write(x)
import math
import random
########################################################
bool=False
p=0
for _ in range(int(input())):
    a,b=INPUT()
    if a==b:
        p+=1
    else:
        p=0
    if p>=3:
        bool=True
if bool:
    print("Yes")
else:
    print("No")
//  [python]
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from fractions import Fraction
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations, accumulate
from operator import add, mul, sub, itemgetter, attrgetter


import sys
# sys.setrecursionlimit(10**6)
# readline = sys.stdin.buffer.readline
readline = sys.stdin.readline

INF = 1 << 60


def read_int():
    return int(readline())


def read_int_n():
    return list(map(int, readline().split()))


def read_float():
    return float(readline())


def read_float_n():
    return list(map(float, readline().split()))


def read_str():
    return readline().strip()


def read_str_n():
    return readline().strip().split()


def ep(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.perf_counter()
        ret = f(*args, **kwargs)
        e = time.perf_counter()

        ep(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(N, D):
    c  = 0
    for d1, d2 in D:
        if d1 == d2:
            c +=1
            if c >= 3:
                return 'Yes'
        else:
            c = 0
    return 'No'


def main():
    N = read_int()
    D = [read_int_n() for _ in range(N)]
    print(slv(N, D))


if __name__ == '__main__':
    main()
//  [java]
import java.io.*;
public class Main{
  public static void main(String args[])throws IOException
  {
   BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
    int n=Integer.parseInt(br.readLine());
    int i,c=0,flag=0;
    String s="";
    for(i=0;i<n;i++)
    {
      s=br.readLine();
      if(s.charAt(0)==(s.charAt(2))){
        c++;
        if(c>2){
        flag=1;
        break;}
      }
      else
        c=0;
      
    }
    if(flag==1)
      System.out.println("Yes");
    else
      System.out.println("No");
  }
}
//  [java]
//package atcoder.beginner179;

import java.io.*;
import java.util.*;

public class Main {
    static InputReader in;
    static PrintWriter out;

    public static void main(String[] args) {
        //initReaderPrinter(true);
        initReaderPrinter(false);
        //solve(in.nextInt());
        solve(1);        
    }

    static void solve(int testCnt) {
        for (int testNumber = 0; testNumber < testCnt; testNumber++) {
            int n = in.nextInt();
            int[] d1 = new int[n], d2 = new int[n];
            for(int i = 0; i < n; i++) {
                d1[i] = in.nextInt();
                d2[i] = in.nextInt();
            }
            int cnt = 0;
            boolean found = false;
            for(int i = 0; i < n; i++) {
                if(d1[i] == d2[i]) {
                    cnt++;
                    if(cnt == 3) {
                        found = true;
                        break;
                    }
                }
                else {
                    cnt = 0;
                }
            }
            out.print(found ? "Yes" : "No");
        }   
        out.close();
    }

    static void initReaderPrinter(boolean test) {
        if (test) {
            try {
                in = new InputReader(new FileInputStream("src/input.in"));
                out = new PrintWriter(new FileOutputStream("src/output.out"));
            } catch (IOException e) {
                e.printStackTrace();
            }
        } else {
            in = new InputReader(System.in);
            out = new PrintWriter(System.out);
        }
    }

    static class InputReader {
        BufferedReader br;
        StringTokenizer st;

        InputReader(InputStream stream) {
            try {
                br = new BufferedReader(new InputStreamReader(stream), 32768);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }

        String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

        Integer[] nextIntArray(int n) {
            Integer[] a = new Integer[n];
            for (int i = 0; i < n; i++) {
                a[i] = nextInt();
            }
            return a;
        }

        Long[] nextLongArray(int n) {
            Long[] a = new Long[n];
            for (int i = 0; i < n; i++) {
                a[i] = nextLong();
            }
            return a;
        }
    }
}
//  [java]
import java.util.*;
import java.io.*;
 
public class Main {
    public static void main(String[] args) throws Exception {
        FastScanner sc = new FastScanner(System.in);
        PrintWriter pw = new PrintWriter(System.out);
        int n = sc.nextInt();
        int cnt = 0;
        boolean flg = false;
        for(int i = 0; i < n; i++){
            int a = sc.nextInt();
            int b = sc.nextInt();
            if(a == b){
                cnt++;
            }else{
                cnt = 0;
            }
            if(cnt >= 3){
                flg = true;
            }
        }
        pw.println(flg ? "Yes" : "No");
        pw.flush();
    }

    static class GeekInteger {
        public static void save_sort(int[] array) {
            shuffle(array);
            Arrays.sort(array);
        }
 
        public static int[] shuffle(int[] array) {
            int n = array.length;
            Random random = new Random();
            for (int i = 0, j; i < n; i++) {
                j = i + random.nextInt(n - i);
                int randomElement = array[j];
                array[j] = array[i];
                array[i] = randomElement;
            }
            return array;
        }
 
    }
}

class FastScanner {
    private BufferedReader reader = null;
    private StringTokenizer tokenizer = null;
    public FastScanner(InputStream in) {
        reader = new BufferedReader(new InputStreamReader(in));
        tokenizer = null;
    }

    public String next() {
        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public String nextLine() {
        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                return reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken("\n");
    }

    public long nextLong() {
        return Long.parseLong(next());
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

    public double nextDouble() {
         return Double.parseDouble(next());
    }
    
    public String[] nextArray(int n) {
        String[] a = new String[n];
        for (int i = 0; i < n; i++)
            a[i] = next();
        return a;
    }

    public int[] nextIntArray(int n) {
        int[] a = new int[n];
        for (int i = 0; i < n; i++)
            a[i] = nextInt();
        return a;
    }

    public long[] nextLongArray(int n) {
        long[] a = new long[n];
        for (int i = 0; i < n; i++)
            a[i] = nextLong();
        return a;
    } 
}
//  [java]
import java.util.Scanner;

public class Main {
	public static void main(String[] args){

		Scanner sc = new Scanner(System.in);

		// 整数の入力
		int a = sc.nextInt();
		int zoro_cnt = 0;

		for (int i = 0; i < a; i++) {
			int b = sc.nextInt();
			int c = sc.nextInt();
			if (b == c) {
				zoro_cnt++;
				if (zoro_cnt >= 3) {
					break;
				}
			} else {
				zoro_cnt = 0;
			}
		}

		if (zoro_cnt >= 3) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}
}
//  [java]
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] d1 = new int[n];
        int[] d2 = new int[n];
        for (int i = 0; i < n; i++) {
            d1[i] = sc.nextInt();
            d2[i] = sc.nextInt();
        }
        int count = 0;
        for (int i = 0; i < n; i++) {
            if(d1[i] == d2[i]) {
                count++;
                if(count > 2) {
                    System.out.println("Yes");
                    return;
                }
            } else {
                count = 0;
            }
        }
        System.out.println("No");
    }
}
//  [java]
import java.util.*;
import java.io.*;
import java.math.*;

public class Main{



  public static OutputStream out=new BufferedOutputStream(System.out);
  static Scanner sc=new Scanner(System.in);
  static long MOD=1000000007l;
  static int INF=10000000;
  static int[] rr=new int[]{1, 0, -1, 0};                                 //rook row move
  static int[] rc=new int[]{0, 1, 0, -1};                                 //rook col move

  //nl-->neew line; //l-->line;  //arp-->array print;  //arpnl-->array print new line
  public static void nl(Object o) throws IOException{out.write((o+"\n").getBytes()); }
  public static void l(Object o) throws IOException{out.write((o+"").getBytes());}
  public static void arp(int[] o) throws IOException{for(int i=0;i<o.length;i++) out.write((o[i]+" ").getBytes()); out.write(("\n").getBytes());}
  public static void arpnl(int[] o) throws IOException{for(int i=0;i<o.length;i++) out.write((o[i]+"\n").getBytes());}
  public static void scanl(long[] a,int n) {for(int i=0;i<n;i++) a[i]=sc.nextLong();}
  public static void scani(int[] a,int n) {for(int i=0;i<n;i++) a[i]=sc.nextInt();}
  public static void scan2D(int[][] a,int n,int m) {for(int i=0;i<n;i++) for(int j=0;j<m;j++) a[i][j]=sc.nextInt();}
  //static variables

  //


  public static void main(String[] args) throws IOException{
    long sttm=System.currentTimeMillis();
    long mod=1000000007l;

    // int k=sc.nextInt();
    int k=1;
    while(k-->0){
        solve();
    }

    out.flush();
  }

  public static void solve() throws IOException{
      int n=sc.nextInt();
      int[][] a=new int[n][2];
      int cnt=0;
      boolean con=false;
      for(int i=0;i<n;i++){
          a[i][0]=sc.nextInt(); a[i][1]=sc.nextInt();
          if(a[i][0]==a[i][1]){
              cnt++;
          }
          else{
              cnt=0;
          }
          if(cnt==3){
              con=true;
              // break;
          }
      }
      if(con){
          nl("Yes");
      }
      else nl("No");
  }

}

class Pair{
  int x; int y;
  Pair(int x,int y){
    this.x=x;
    this.y=y;
  }
}
//  [cpp]
#include <cstdio>
using namespace std;
int a,b,cnt;
int n;
bool flag=false;
int main(){
	scanf("%d",&n);
	for(int i=0;i<n;++i){
		scanf("%d%d",&a,&b);
		if(a==b)++cnt;
		else cnt=0;
		if(cnt==3)flag=true;
	}
	if(flag)printf("Yes\n");
	else printf("No\n");
	return 0;
}
//  [cpp]
//default library
#include <stdio.h>
#include <string.h>
//extra library


//default define
#define ll long long int
#define fl(i,a,n) for(int i = a; i < (n); i++)
#define fls(i,a,s) for(int i = a; s[i] != '\0'; i++)
#define endl puts("")
#define kill return 0

//extra define


//declare function


//main code
int main() {
	int t,check = 0;
	scanf("%d", &t);
	for(int i = 0; i < t; i++){
		int a,b;
		scanf("%d %d", &a, &b);
		if(a == b){
			check++;
		}else{
			check = 0;
		}
		if(check == 3){
			puts("Yes");
			kill;
		}
	}
	puts("No");
    return 0;
}

//functions
//  [cpp]
#include <bits/stdc++.h>
#include <boost/foreach.hpp>
using namespace std;
#define pi 2*asin(1.0)
#define MAX 10000000
#define MOD 1000000007
#define _GLIBCXX_DEBUG
 
vector<long> fac(MAX);
vector<long> finv(MAX);
vector<long> inv(MAX);
vector<long> Primelist;
//template functions
/////////////////////////
void Prinit(){
long PR=10000001;
vector<long> P(PR,0);
for(long i=2;i*i<PR;i++){
    if(P.at(i)==0){
        long j=i;
      j+=i;
        while(j<PR){
            P.at(j)=1;
             j+=i;         
        }
    }
}
 
for(long i=2;i*i<PR;i++){//Primelist.size()=446
    if(P.at(i)==0){
        Primelist.push_back(i);
    }
}
}
 
void Cominit(){
  fac.at(0)=fac.at(1)=1;
  finv.at(0)=finv.at(1)=1;
  inv.at(1)=1;
  for(long i=2;i<MAX;i++){
      fac.at(i)=(fac.at(i-1)*i)%MOD;
      inv.at(i)=MOD-inv.at(MOD%i)*(MOD/i)%MOD;
      finv.at(i)=finv.at(i-1)*inv.at(i)%MOD;
  }
}
 
long facComb(long N,long M){// nCm%
if(N<M) return 0;
if(N<0||M<0) return 0;
return fac.at(N)*(finv.at(M)*finv.at(N-M)%MOD)%MOD;
}
 
long Comb(long N,long M){// nCm
long ans=1;
for(long i=N;i>N-M;i--){
    ans=ans*i;
}
for(long i=M;i>0;i--){
    ans=ans/i;
}
return ans;
}
 
long Perm(long N,long M){// nPm
long ans=1;
for(long i=N;i>N-M;i--){
    ans=ans*i;
}
return ans;
}
 
long GCM(long A,long B){
            long W,r;
    if(A<B){
 
        W=B;
        B=A;
        A=W;
    }
    while(A%B!=0){
        r=A%B;
        A=B;
        B=r;
    }
    return B;
}
long LCM(long A,long B){
    return (A*B)/GCM(A,B);
}
 
long upDiv(long a,long b){
  return (a+b-1)/b;
}
 
long strtolong(string str){
istringstream ss;
ss=istringstream(str);
long num;
ss>>num;
return num;
}
 
long chartolong(char ch){
long num;
num=ch-'0';
return num;
}
 
long Max2(long a,long b){
if(a>b){
    return a;
}else{
    return b;
}
}
 
long Min2(long a,long b){
if(a>b){
    return b;
}else{
    return a;
}
}
 
 
string longtostr(long N){
    string str;
    str=to_string(N);
    return str;
}
 
 
 
 
 
 
 
 
 
/////////////////////////
 
 
//Answer
 
 
int main() {
Prinit();
long N,cou=0,flag=0;
cin>>N;
vector<vector<long>> D(N,vector<long>(2));
for(long i=0;i<N;i++){
cin>>D.at(i).at(0)>>D.at(i).at(1);
}
for(long i=0;i<N;i++){
    if(D.at(i).at(0)==D.at(i).at(1)){
        cou++;
    }else{
        cou=0;
    }
    if(cou>=3){
        flag=1;
    }
}
if(flag==1){
    cout<<"Yes"<<endl;
}else{
    cout<<"No"<<endl;
}
 
 
}
//  [cpp]
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define int long long
#define all(sdk) sdk.begin(),sdk.end()
#define mll map<ll, ll>
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define rep(i,a,b) for(ll i=a;i<b;++i)
#define repd(i,a,b) for(ll i=a;i>=b;--i)
//#define mp make_pair
#define hell 1000000007
#define endl '\n'
#define vvll vector<vector<int> >
#define vll vector<int>
#define mint map<int,int>
#define sz(x) (int)x.size()
#define sll set<int>
#define pll pair<int,int>
#define F first
#define S second
#define INF 1e18
#define inf 1e10
#define NINF -1e16

#define N 1000005
int spf[N];
vll primes,prev[N],next[N];
set<int>s;
void sieve()
{
	rep(i,2,N)
	{
		if (spf[i]==0)
		{
			spf[i]=i;
			for(int j=2*i;j<=N;j+=i)
			{
				if(spf[j]==0)
					spf[j]=i;
			}
		}
	}
}
void SieveOfEratosthenes(int n) 
{ 
    bool prime[n+1]; 
    memset(prime, true, sizeof(prime)); 
  
    for (int p=2; p*p<=n; p++) 
    { 
        if (prime[p] == true) 
        { 
            for (int i=p*2; i<=n; i += p) 
                prime[i] = false; 
        } 
    }
    for (int p=2; p<=n; p++) 
    {
        if (prime[p]) 
        {
            primes.pb(p); 
            s.insert(p);
        }
    }    
} 
// bool isPrime(ll n) 
// { 
//     if (n <= 1) 
//         return false; 
//     if (n <= 3) 
//         return true; 
//     if (n % 2 == 0 || n % 3 == 0) 
//         return false; 
//     for (int i = 5; i * i <= n; i = i + 6) 
//         if (n % i == 0 || n % (i + 2) == 0) 
//             return false; 
//     return true; 
// } 
// ll power(ll x,ll y)
// {
//     ll X=x;
//     //X=X%p;//if x is greater than p
//     if(X==0)
//     {
//         return 0;
//     }
//     ll res=1ll;
//     while(y>0)
//     {
//         if(y&1)
//         {
//             res=((res)*(X));
//             y--;
//         }
//         y=y>>1;
//         X=((X)*(X));
//     }
//     // res=(res>=0)?(res%p):(res+p)%p;
//     return(res);
// }
// void dfs(int u, int par){
//     cnt[u] = 1;
//     p[u] = par;
//     for(int i : g[u]){
//         if(i != par){
//             dfs(i,u);
//             cnt[u] += cnt[i];
//         }
//     }
// }
// int children(vll v[],int parent,int src,vll& chil)
// {
// 	int ans =0;
// 	for(auto it:v[src])
// 	{
// 		if(it!=parent)
// 		{
// 			ans+= 1+children(v,src,it,chil);
// 		}
// 	}
// 	chil[src] = ans;
// 	return ans;
 
// }
bool cmp(const pair<int,int>&a,const pair<int,int>&b)
{
    if (a.F==b.F)
    return a.S<b.S;
    else
    return a.F>b.F;
}
signed main() {
	//freopen("output.txt","w",stdout);
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	srand (static_cast <unsigned> (time(0)));
	SieveOfEratosthenes(1000005); 
// 	sort(all(primes));
    sieve();
	int t=1;
	//cin >> t;
	while (t--) 
	{
	    int n;
	    cin >> n;
	    int flag=0,c=0;
	    rep(i,0,n)
	    {
	        int x,y;
	        cin >> x>>y;
	        if (x==y)
	        c++;
	        else
	        c=0;
	        if (c>=3)
	        {
	            flag=1;
	        }
	    }
	    if (flag==1)
	    cout <<"Yes";
	    else
	    cout <<"No";
	}
	return 0;
}
//  [c]
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
typedef long long ll;


int main()
{
    int n;
    scanf("%d",&n);
    int d[n][2];
    int h[n];
    for(int i=0;i<n;i++)
    {
        scanf("%d %d",&d[i][0],&d[i][1]);
        if(d[i][0]==d[i][1])
        {
            h[i]=1;
        }
        else
        {
            h[i]=0;
        }
    }
    
    int maxs=0;
    int str=0;

    for(int i=0;i<n;i++)
    {
        if(h[i]==1)
        {
            str=str+1;
            maxs=fmax(maxs,str);
        }
        else
        {
            str=0;
        }
        
    }

    
    if(maxs>2)
    {
        printf("Yes\n");
    }
    else
    {
        printf("No\n");
    }
    

    return 0;
}
//  [c]
/*
 * main.c
 *
 *  Created on: 2020/03/28
 *      Author: family
 */

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define MAX(a,b) (a > b ? a : b)
#define MIN(a,b) (a > b ? b : a)
typedef long long int ll;
typedef unsigned long long int ull;

int sort_inc(const void *a, const void *b) { return (*(int*)a - *(int*)b);}
int sort_dec(const void* a, const void* b) { return (*(int*)b - *(int*)a);}
int sort_dec_ll(const void *a, const void *b) {
    ll da = *(ll*)a, db = *(ll*)b;    int val = 0;
    if(da > db) { val = -1; }
    else if (da == db) { val = 0; }
    else { val = 1; }
    return val;
}
int sort_inc_ll(const void *a, const void *b) {
    ll da = *(ll*)a, db = *(ll*)b;    int val = 0;
    if(da > db) { val = 1; }
    else if (da == db) { val = 0; }
    else { val = -1; }
    return val;
}
int sort_dic(const void *a, const void *b) {
    char *pa = (char *)a;    char *pb = (char *)b;    int i = 0, val = 0, N = 10;
    for (i = 0; i < N; i++) {
    	char da = pa[i], db = pb[i];
    	if (da == db) continue;
  		if (da > db) val = 1; else val = -1;
        break;
    }
    return val;
}

void yesno(int ans) {
	if (ans == 1) {	printf("Yes\n");
	} else {		printf("No\n");	}
	return;
}

void okng(int ans) {
	if (ans == 1) { printf("OK\n");
	} else { 		printf("NG\n");	}
	return;
}

int D[101][2] = {0};
int main()
{
	int N = 0;
	scanf("%d", &N);
	int i = 0;
	memset(&D,0,sizeof(D));

	for (i = 0; i < N; i++) {
		scanf("%d %d", &D[i][0], &D[i][1]);
	}

	int same = 0, count = 0, ans = 0;
	for (i = 0; i < N; i++) {
		if (D[i][0] == D[i][1]) {
			same = 1;
		} else {
			same = 0;
			count = 0;
		}
		if (same == 1) {
			count++;
		}
		if (count == 3) {
			ans = 1;
		}
	}

	yesno(ans);
	return 0;
}
//  [c]
#include<stdio.h>
 int main(){
    int n;
     scanf("%d",&n);
      int Ar[2*n];
        for(int i=0;i<(2*n);i++){
             scanf("%d",&Ar[i]);
        }
        int count=0;
          int track=0;
        for(int i=0;i<(2*n);i=i+2){
            int k= count;
             if(Ar[i]==Ar[i+1]){
                 count++;
             }
             if(count>k){
                  track++;
             }
             else if(track>=3){
                 track=track;
             }
             else track=0;
        }
        if(track>=3) {
            printf("Yes");
        }
        else printf("No");

}
//  [c]
#include <stdio.h>
#include <stdbool.h>

void doublets_occur(void) {
  bool yes = false;
  int n;
  scanf("%d", &n);
  bool arr[n];
  for (int i = 0; i < n; i++) {
    int d1, d2;
    scanf("%d%d", &d1, &d2);
    if (d1 == d2) {
      arr[i] = true;
    } else {
      arr[i] = false;
    }
  }
  for (int i = 0; i < n - 2; i++) {
    if (arr[i] && arr[i+1] && arr[i+2]) {
      yes = true;
      break;
    }
  }
  if (yes) {
    printf("Yes\n");
  } else {
    printf("No\n");
  }
}


int main(void) {
  doublets_occur();
  return 0;
}
//  [c]
#include<stdio.h>

int main(void){
  int s,i,j,N,a[100],b[100],count=0;
  scanf("%d",&N);
  for(i=0;i<N;i++){
     scanf("%d ",&a[i]); scanf("%d",&b[i]);
  }
  for(j=2;j<N;j++){
    if(a[j-2]==b[j-2]&&a[j-1]==b[j-1]&&a[j]==b[j])
      count=1;
  }
  if(count)
    printf("Yes\n");
  else
    printf("No\n");
  
  return 0;

}
//  [c]
#include <stdio.h>

int main(){
    int n, cnt, ans;
    int S[101], T[101];

    ans = 0;
    cnt = 0;

    scanf("%d",&n);
    for (int i=0;i<n;i++) {
        scanf("%d %d",&S[i],&T[i]);
        if(S[i] == T[i]) cnt++;
        else cnt = 0;
        if(cnt > 2) ans++;
    }
    if(ans > 0) printf("Yes");
    else printf("No");
    return 0;
}
//  [javascript]
const main = (input) => {
  const [, ...arr] = input.trim().split('\n')
  let count = 0

  for (let i=0; i<arr.length; i++) {
    const [a, b] = arr[i].split(' ').map(Number)

    if (a !== b) count = 0

    if (a === b) {
      count++
      if (count === 3) return console.log('Yes')
    }
  }
  return console.log('No')
}

process.env.MYTEST
  ? (process.env.MYTEST === 'test' ? test() : main(require('fs').readFileSync('dev/stdin', 'utf8')))
  : main(require('fs').readFileSync('/dev/stdin', 'utf8'))
//  [javascript]
'use strict';
function Main(input) {

	input = input.trim().split("\n");
  
  	let count = 0;
  	for(let i = 1 ; i< input.length; i++){
      let nums = input[i].split(" ");
      let a = nums[0];
      let b = nums[1];
      if(a === b){
        count++;
		if(count >= 3){
          console.log("Yes");
          return;
        }
      }else{
        count = 0;
      }
    }
    	console.log('No');
}



//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function Main(input) {
	const splited = input.split("\n");
	const a = parseInt(splited[0], 10);
    let res = "No";
    let count = 0;
  	for (let i = 1; i <= a; i++) {
        const t = splited[i].split(" ");
        if (parseInt(t[0], 10) === parseInt(t[1], 10)) {
            count++;
            if (count >= 3) {
                  res = "Yes";
                  break;
            }
            continue;
        }
        count = 0;
    }
	//出力
	console.log(res);
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function Main(input) {
    input = input.trim().split("\n").map(function(x) { return x.split(" ")});
    let N = parseInt(input[0][0], 10);
    let arr_D = [];
    for (let i = 0; i < N; i++){
        arr_D.push(input[i + 1].map(e => parseInt(e, 10)));
    }
    arr_D.push([0, 1]);
    let tmp = -1;
    let tmp2;
    let ans = 'No';
    for (let i = 0; i < N + 1; i++){
        if (arr_D[i][0] !== arr_D[i][1]){
            tmp2 = i;
            if (tmp2 - tmp > 3){
                ans = 'Yes';
                break;
            } else {
                tmp = tmp2;
            }
        }
    }
    console.log(ans);
    
    
}



Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function Main(input) {
  const lines = input.split('\n');
  const zoro_count = lines[0];
  for(var i=1; i< lines.length; i++){
    const me = lines[i].split(' ');
    if (me[0] == me[1]){
      lines[i] ="zoro";
    }else{
      lines[i] ="";
    }
  }
  for(var i=1; i< (lines.length-2); i++){
    if ( (lines[i] == "zoro") && (lines[i+1] == "zoro") && (lines[i+2]=="zoro")){
        console.log("Yes");
        return;
    }
  }
  console.log("No");
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function main(input) {
  	const results = input.split('\n').slice(1)
	let doubletNum = 0

    const result = results.some(res => {
        const [a, b] = res.split(' ')
    	doubletNum = a === b ? doubletNum+1 : 0
      	return doubletNum >= 3
    })
	console.log(result ? 'Yes' : 'No')
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
)

func process(in []string) (ret string) {
	count := 0
	for _, v := range in {
		var one, two int
		fmt.Sscanf(v, "%d %d", &one, &two)
		if one == two {
			count++
		} else {
			count = 0
		}
		if count == 3 {
			return "Yes"
		}
	}
	return "No"
}

func main() {
	var n int
	fmt.Scanf("%d\n", &n)

	sc := bufio.NewScanner(os.Stdin)
	in := make([]string, n)
	for i := 0; i < n; i++ {
		if sc.Scan() {
			in[i] = sc.Text()
		}
	}

	ret := process(in)
	fmt.Println(ret)

}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
	"strconv"
	"strings"
)

func main() {
	io := NewIo(os.Stdin, os.Stdout)
	defer io.Flush()
	n := io.NextInt()
	d1, d2 := make([]int, n), make([]int, n)
	for i := 0; i < n; i++ {
		d1[i], d2[i] = io.NextInt(), io.NextInt()
	}
	cnt := 0
	for i := 0; i < n; i++ {
		if d1[i] == d2[i] {
			cnt++
			if cnt == 3 {
				io.Println("Yes")
				return
			}
		} else {
			cnt = 0
		}
	}
	io.Println("No")
}

// Io is I/O object
type Io struct {
	reader    *bufio.Reader
	writer    *bufio.Writer
	tokens    []string
	nextToken int
}

// NewIo returns a new Io instance
func NewIo(r io.Reader, w io.Writer) *Io {
	return &Io{
		reader: bufio.NewReader(r),
		writer: bufio.NewWriter(w),
	}
}

// Flush flushes writer
func (io *Io) Flush() {
	err := io.writer.Flush()
	if err != nil {
		panic(err)
	}
}

// NextLine scans a line from stdin
func (io *Io) NextLine() string {
	var buffer []byte
	for {
		line, isPrefix, err := io.reader.ReadLine()
		if err != nil {
			panic(err)
		}
		buffer = append(buffer, line...)
		if !isPrefix {
			break
		}
	}
	return string(buffer)
}

// Next return a word from stdin
func (io *Io) Next() string {
	for io.nextToken >= len(io.tokens) {
		line := io.NextLine()
		io.tokens = strings.Fields(line)
		io.nextToken = 0
	}
	r := io.tokens[io.nextToken]
	io.nextToken++
	return r
}

// NextInt returns an integer from stdin
func (io *Io) NextInt() int {
	i, err := strconv.Atoi(io.Next())
	if err != nil {
		panic(err)
	}
	return i
}

// Println is a wrapper of fmt.Fprintln
func (io *Io) Println(a ...interface{}) {
	fmt.Fprintln(io.writer, a...)
}
//  [go]
package main

import (
	"fmt"
)

func main() {
	var n, d, dd int

	fmt.Scanf("%d", &n)
	slice1 := make([]int, 100, 100)
	slice2 := make([]int, 100, 100)
	for i := 0; i < n; i++ {
		fmt.Scanf("%d %d", &d, &dd)
		slice1[i] = d
		slice2[i] = dd
	}
	total := 0
	for i := 0; i < n; i++ {
		if total >= 3 {
			break
		}
		if slice1[i] == slice2[i] {
			total++
		} else {
			total = 0
		}
	}
	if total >= 3 {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	numT := scanner.Text()
	num, _ := strconv.ParseInt(numT, 10, 64)

	zoroCounter := 0

	for i := 0; i < int(num); i++ {
		scanner.Scan()
		numsLine := scanner.Text()
		nums := strings.Split(numsLine, " ")

		if nums[0] == nums[1] {
			zoroCounter++
			continue
		}
		if zoroCounter < 3 {
			zoroCounter = 0
		}
	}

	if zoroCounter >= 3 {
		fmt.Println("Yes")
		return
	}
	fmt.Println("No")
}
//  [ruby]
N = gets.to_i

sum = 0
[*0...N].map{ gets.split.uniq.size == 1 }.each { |e|
  e ? sum += 1 : sum = 0
  if sum >= 3 then
    puts "Yes"
    return
  end
}

puts "No"
//  [ruby]
N = gets.to_i
a, b = N.times.map{gets.split.map(&:to_i)}.transpose


kaisuu = 0
for i in 0..N-3
    if a[i] == b[i] && a[i+1] == b[i+1] && a[i+2] == b[i+2] then
        puts 'Yes'
        exit
    end
end
puts "No"
//  [ruby]
N = gets.to_i
ary = []
N.times do
    d1, d2 = gets.split.map(&:to_i)
    ary << (d1 == d2)
end
(N-2).times do |n|
    if ary[n] && ary[n+1] && ary[n+2]
        puts 'Yes'
        exit
    end
end
puts 'No'
//  [ruby]
require 'set'; require 'prime'; require 'pp'
INF=Float::INFINITY; MOD=10**9+7
n = gets.chomp.to_i
count = 0
n.times do
  x,y = gets.chomp.split.map(&:to_i)
  if x == y
    count+=1
  else
    count = 0
  end

  if count >= 3
    puts 'Yes'
    exit
  end
end

puts 'No'
//  [ruby]
#exec({'RUBY_THREAD_VM_STACK_SIZE'=>'100000000'},'/usr/bin/ruby', $0) if !ENV['RUBY_THREAD_VM_STACK_SIZE']
require 'prime'

def inpf() a=gets.chomp.split(" ").map(&:to_f)end

def inps() a=gets.chomp.split(" ")end

def copy(a) Marshal.load(Marshal.dump(a)) end

def kaijo(n,r = 10**9+7)(n < 2)? 1 : (2..n).inject{|memo,u|memo=(memo*u)%r} end

def na(n,d=0) Array.new(n,d)end

def na2(n,m,d=0) Array.new(n){Array.new(m,d)}end

def na3(n,m,l,d=0) Array.new(n){Array.new(m){Array.new(l,d)}}end

def inp() a=gets.chomp.split(" ").map(&:to_i)end

def r_up(a, b) (a+b-1)/b end

def sum(a) a.inject(:+) end

def big(a,b) return (a>b)? a:b end

def small(a,b) return (a<b)? a:b end

#exec({'RUBY_THREAD_VM_STACK_SIZE'=>'100000000'},'/usr/bin/ruby', $0) if !ENV['RUBY_THREAD_VM_STACK_SIZE']
require 'prime'

def inpf() a=gets.chomp.split(" ").map(&:to_f)end

def inps() a=gets.chomp.split(" ")end

def copy(a) Marshal.load(Marshal.dump(a)) end

def kaijo(n,r = 10**9+7)(n < 2)? 1 : (2..n).inject{|memo,u|memo=(memo*u)%r} end

def na(n,d=0) Array.new(n,d)end

def na2(n,m,d=0) Array.new(n){Array.new(m,d)}end

def na3(n,m,l,d=0) Array.new(n){Array.new(m){Array.new(l,d)}}end

def inp() a=gets.chomp.split(" ").map(&:to_i)end

def r_up(a, b) (a+b-1)/b end

def sum(a) a.inject(:+) end

def big(a,b) return (a>b)? a:b end

def small(a,b) return (a<b)? a:b end

n = inp[0]
now = 0
n.times do 
  d = inp
  if d.uniq.size == 1
    now += 1
  else
    now = 0
  end
  if now == 3
    puts "Yes"
    exit
  end
end
puts "No"
//  [ruby]
puts`dd`[/(.) \1
(.) \2
(.) \3/]?:Yes: :No
//  [rust]
use std::io;

fn procon_read<T: std::str::FromStr>() ->  Vec<T> {
    let mut buf = String::new();
    io::stdin().read_line(&mut buf).expect("");
    let iter = buf.split_whitespace();
    let mut v: Vec<T> = Vec::new();
    for i in iter {
        v.push(i.parse().ok().unwrap());
    }
    v
}

fn main() {
    let mut flag = false;
    let n:u64 = procon_read()[0];
    let mut bef = String::new();
    for i in 0..n {
        let v:Vec<u64> = procon_read();
        if v[0] == v[1] {
            bef = format!("{}1", bef);
        }else{
            bef = format!("{}0", bef);
        }
    }
    for i in 0..(bef.len()-2) {
        if &bef[i..(i+3 as usize)] == "111" {
            flag = true;
            break;
        }
    }
    if flag {
        println!("Yes");
    }else{
        println!("No");
    }
}
//  [rust]
#![allow(clippy::needless_range_loop)]
#![allow(unused_macros)]
#![allow(dead_code)]
#![allow(unused_imports)]

use itertools::Itertools;
use proconio::input;
use proconio::marker::*;

fn main() {
    input! {
        d: [(usize, usize)]
    }

    let mut cnt = 0;
    let mut max = 0;
    for &(a, b) in &d {
        if a == b {
            cnt += 1;
        } else {
            cnt = 0;
        }

        if max < cnt {
            max = cnt;
        }
    }

    if max >= 3 {
        println!("Yes");
    } else {
        println!("No");
    }
}
//  [rust]
use proconio::input;

fn main() {
    input! {
        n: usize,
        d: [(usize, usize); n],
    }
    let z = d.windows(3).any(|w| {
        let (x, y, z) = (w[0], w[1], w[2]);
        x.0 == x.1 && y.0 == y.1 && z.0 == z.1
    });
    if z {
        println!("Yes");
    } else {
        println!("No");
    }
}
//  [swift]
let n = Int(readLine()!)!
var c = 0
for i in 1...n{
  let d = readLine()!.split(separator:" ").map{Int($0)!}
  if d[0] == d[1]{
    c += 1
  }else{
    c = 0
  }
  if c == 3{
    print("Yes")
    break
  }
  if i == n{
    print("No")
  }
}
//  [swift]
let n = Int(readLine()!)!
var dArray = [[Int]]()
for _ in 0..<n {
  dArray.append(readLine()!.split(separator: " ").map {Int($0)!})
}

var sameCount = 0
var answer = "No"
var i = 0

while i < dArray.count {
  if dArray[i][0] == dArray[i][1] {
    sameCount += 1
  } else {
    sameCount = 0
  }
  i += 1
  if sameCount == 3 {
    answer = "Yes"
    break
  }
}

print(answer)
//  [swift]
let n = Int(readLine()!)!

var hit = 0

var ans = "No"

for _ in 0..<n {
  let inp = readLine()!.split(separator: " ").map { Int($0)! }
  if inp[0] == inp[1] {
    hit += 1
  } else {
    hit = 0
  }
  if hit == 3 {
    ans = "Yes"
    break
  }
}
print(ans)
//  [swift]
import Foundation

func main() {
 var n = Int(readLine()!)!
 var successTimes = 0
 
 for _ in 1...n {
   let inputString = readLine()!
   let split: [Int] = inputString.components(separatedBy: " ").map{Int(String($0))!}
   if (split[0]==split[1]) {
     successTimes += 1
     if (successTimes == 3) {
        print("Yes")
        return
     }
   } else {
     successTimes = 0
   }
 }
 
 print("No")

}

main()
//  [swift]
import Foundation
func toTuple<T>(_ args: [T]) -> (T, T) { (args[0], args[1]) }
func readInts() -> [Int] { readLine()!.split(separator: " ").map { Int($0)! } }

let n = Int(readLine()!)!
var count = 0
var ans = "No"
for _ in 0..<n {
  let (dl, dr) = toTuple(readInts())
  if dl == dr {
    count += 1
  } else {
    count = 0
  }
  if count == 3 {
    ans = "Yes"
  }
}
print(ans)
//  [typescript]
import * as fs from 'fs';
// main
function main(input: string[]) {
    // param
    let n;
    let dn: number[][];
    let ans;
    // init
    n = Number(input.shift());
    dn = new Array(n);
    for (let nx = 0; nx < n; nx++) {
        dn[nx] = input[nx].split(" ").map(x => Number(x));
    }
    // solve
    ans = "No";
    let cnt = 0;
    for (let nx = 0; nx < n; nx++) {
        if (dn[nx][0] == dn[nx][1]) {
            cnt++;
            if (3 <= cnt) {
                ans = "Yes";
                break;
            }
        } else {
            cnt = 0;
        }
    }
    // answer
    console.log(ans);
}
// entrypoint
function entrypoint() {
    try {
        // linux
        let input = fs.readFileSync("/dev/stdin", "utf8").trim().split("\n");
        console.debug = function () { };
        main(input);
    }
    catch (ex) {
        // windows
        const lines: string[] = [];
        // @ts-ignore
        const reader = require('readline').createInterface({
            // @ts-ignore
            input: process.stdin,
            // @ts-ignore
            output: process.stdout
        });
        reader.on('line', function (line: string) {
            lines.push(line);
        });
        reader.on('close', function () {
            let input = lines;
            main(input);
        });
    }
}
entrypoint();
//  [python]
import math
N = int(input())

count = 0
for i in range(1, N+1):
  for j in range(i, N+1):
    k = N - i*j
    #print(i,j,k)
    if k >0:
      if i==j:
        count += 1
      else:
        count += 2
    else:
      break
print(count)
//  [python]
n = int(input())
cnt = 0

for i in range(3,n):
  for j in range(1,n//i+1):
    if i * j < n:
      cnt +=1
      
print(cnt+n-1+(n-1)//2)
//  [python]
k=int(input())


cnt=0
if k>6:
    for i in range(7,k):
        for j in range(1,k):
            
                
            if i*j<k:
                cnt+=1
            else:
                break
print(cnt+k-1+((k-1)//2)+((k-1)//3)+((k-1)//4)+((k-1)//5)+((k-1)//6))
//  [java]
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main {

    void solve(Scanner in, PrintWriter out) {
        int n = in.nextInt();
        int cpt = 0;
        for (int c = 1; c < n; ++c) {
            cpt += nbFactors(n - c);
        }
        out.println(cpt);
    }

    public static int nbFactors(int n) {
        int cpt = 0;
        for(int i = 1; i <= (int) Math.sqrt(n); i++)
        {
            if(n % i == 0 && i * i != n)
            {
                cpt += 2;
            }
            else if (i * i == n)
            {
                cpt++;
            }
        }
        return cpt;
    }

    public static void main(String[] args) {
        try(Scanner in = new Scanner(System.in);
            PrintWriter out = new PrintWriter(System.out)) {
            new Main().solve(in, out);
        }
    }
}
//  [java]
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
      	
        // 入力
        int n = sc.nextInt();
      	int count=0;
      
      	for(int i=1;i<n;i++){
          double up=Math.sqrt(n-i);
          if(up%1==0){
            count+=1;//平方数の部分
          }
          if((n-i)%2==0){//2の倍数で計算量削減
            for(int j=1;j<up;j++){
              if((n-i)%j==0){
                count+=2;
              }
            }
          }else{
            for(int j=0;j<up/2-0.5;j++){
              if( (n-i)%(2*j+1)==0 ){
                count+=2;
              }
            }
          }
          
        }

      System.out.println(count);
      
    }
}
//  [java]
import java.util.*;
public class Main {
  	public static int muld(int n,int m){
      int cnt = 0;
      for(int i = 1;i <= n/i;i++){
        if(n % i == 0){
          if(i == n/i) cnt++;
          else cnt += 2;
        }
      }
      if(n == m) return cnt;
      else return muld(n-1,m)+cnt;
    }
  
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
      	int cnt;
   
      	if(n <= 630000) cnt = muld(n-1,1);
      	else cnt = 8509899 + muld(n-1,630000);
      
		System.out.println(cnt);
	}
}
//  [cpp]
#include<iostream>
using namespace ::std;
#include<math.h>
int main(){
	
	int n,ans,m,fans;
	m=0;
	fans=0;
	ans=0;
	cin>>n;
	for(int c=1;c<=n;c++){
		
		m=sqrt(n-c);
		
		for(int a=1;a<=m;a++){
			
			if(((n-c)%a==0)&&(n-c)/a!=a){
				ans+=2;
			}
			else if((n-c)%a==0){
				ans++;
			}
			
		}
		
	}
cout<<ans;
return 0;
}
//  [cpp]
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;

int calcA(int n) {
    int res = 0;
    {
        int i;
        for (i = 1; i*i < n; i++) {
            if (n%i == 0) {
                res += 2;
            }
        }
        if (i*i == n) {
            res++;
        }
    }
    return res;
}

int main(void){
    int n;
    cin >> n;

    vector<int> a(n);
    rep(i,n) {
        a[i] = calcA(i);
    }

    int ans = 0;
    rep(i,n) {
        ans += a[i];
    }
    cout << ans << endl;
    return 0;
}
//  [cpp]
#include<bits/stdc++.h>

int i = 0,j = 0,k = 0;
#define INT             long long
#define mod             1000000007
#define inf             (int)1e18
#define endl            "\n"
#define FOR(a, b)       for (int i = a; i < b;i++)
#define inpArr(vec)          for(auto &it:vec) cin>>it
#define outArr(vec)          for(auto &it:vec) cout<<it<<" ";cout<<endl;
#define read(n) 			INT n;cin >> n;
#define readTwo(x, y) 		INT x, y;cin>>x>>y;
#define readThree(x, y, z) 	INT x, y, z;cin>>x>>y>>z;
#define readFour(x, y, z,a) INT x, y, z, a;cin>>x>>y>>z>>a;

using namespace std;
int sol(int x){
	int count = 0;
	int i = 1;
	int flag = 0;
	while(i*i<=x){
		if(x%i==0){
			if(i==x/i)
				flag = 1;
			count++;
		}
		i++;
	}
	if (flag){
		return 2 * count - 1;
	}
	return 2 * count;
}
void solve(){
	read(n);
	INT ans = 0;
	for (int i = 1; i < n; i++)
	{
		ans += sol(i);
	}
	cout << ans << endl;
}

int main(){
ios_base::sync_with_stdio(0);cin.tie(NULL);

int t=1;
// cin >> t;
while(t--){
	solve();
}

return 0;
	
}
//  [c]
#include<stdio.h>
#include<math.h>
int mene(int num){
	int toori=0;
	for(int i=1;i<=sqrt(num);i++){
		if((num/i)*i==num){
			toori+=2;
		}
		if(num==i*i)toori--;
	}
	return(toori);
}
int main()
{
   int ans=0;
   int n;
   scanf("%d",&n);
    for(int i=1;i<n;i++){
		ans+=mene(i);
   }
   printf("%d",ans);
}
//  [c]
#include <stdio.h>
#define SHORYAKU
int yakusuu(int);

int main(void){
  int n,ab=2,count=1; // count=1はa*b=1の分(yakusuu(1)が機能しないため)
  if(scanf("%d",&n) == EOF) return 1;
  
#ifdef SHORYAKU // Nが750000以上だった場合、750000までの計算を省略します^q^
  if(n>=750000){
    count=10261678;
    ab=750000;
  }
#endif
  for(;ab<n;ab++){
    count += yakusuu(ab); // cはa*bが決まれば一通りに特定される "a*b=k"を満たすa,bの組はkの約数と等しい
  }
  printf("%d\n",count);
  return 0;
}

int yakusuu(int n){ // nの約数の数を返す
  int i,count=2; // 2は 1とn自身
  for(i=2; n/i >= i; i++){ // iは約数の候補
    if(n%i == 0) {
      if(n/i == i) count++;
      else count+=2;
    }
  }
  return count;
}
//  [c]
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include <limits.h>
#include <stdbool.h>

int main(void){
    
    int n;
    int cnt=1, ans=0;
    int flag=0;
    
    scanf("%d", &n);
    
    for (int z=1; z<=n-1; z++) {
        flag=0;
        cnt=0;
        for (int i=1; i<=sqrt(z); i++) {
            if (z%i==0) {
                cnt++;
                if (z==i*i) {
                    flag++;
                }
            }
        }
        cnt*=2;
        if (flag) {
            cnt-=flag;
        }
        ans+=cnt;
    }
    
    printf("%d", ans);
    
    return 0;
}
//  [javascript]
function Main(input) {
input = input.split("\n");//行ごとに分解して配列にする。一行の時は"\n"を" "にして三行目を消そう

var a = input[0]
count = 0;

for(i=1; i< a; i++){

  for(j=1; j<a; j++){
  	if(i*j < a){
    	count++; 
    }else{
    	break; 
    }
  }
}
console.log(count);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));//おまじない
//  [javascript]
function Main(input) {
    const total = parseInt(input, 10);
    let counter = 0;
  
    let finish = false;
    for (let i = 1; i <= total; i++) {
        for (let t = 1; t <= total; t++) {
            for (let v = total - (i * t); v <= total; v++) {
                if (v <= 0 || total < (i * t) + v) {
                      break;
                }
                counter++;
            }
            if (total <= i * t) {
                break;
            }
        }
    }
  
  //出力
  console.log(counter);
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function spilitInput(input) {
  var splited = [];
  var rows = input.split('\n');
  for (var i = 0; i < rows.length; i += 1) {
    splited.push(rows[i].split(' '));
  }
  return splited;
}
function Main(input) {
  var splited = spilitInput(input);
  var N = splited[0][0];
  
  var counter = 0;
  for (var A = 1; A < N; A += 1) {
  for (var B = 1; (A * B) < N; B += 1) {
    counter += 1;
  }
  }

  console.log(counter);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [go]
package main

import (
	"fmt"
	"math"
)

func main() {
	var n float64
	fmt.Scan(&n)
	cnt := 0
	for c := float64(n - 1); c >= 1; c-- {
		max := math.Floor(math.Sqrt(n - c))
		for a := float64(1); a <= max; a++ {
			b := (n - c) / a
			if b == math.Floor(b) {
				if a != b {
					cnt += 2
				} else {
					cnt++
				}
			}
		}
	}
	fmt.Println(cnt)
}
//  [go]
package main

import (
	"fmt"
	"math"
)

func main() {
	var n float64
	fmt.Scan(&n)
	cnt := 0
	for c := float64(n - 1); c >= 1; c-- {
		max := math.Floor(math.Sqrt(n - c))
		for a := float64(1); a <= max; a++ {
			b := (n - c) / a
			if b == math.Floor(b) {
				cnt++
				if a != b {
					cnt++
				}
			}
		}
	}
	fmt.Println(cnt)
}
//  [ruby]
N=gets.to_i
n1 = N - 1
n2 = n1
res = 0
ans = []
tmp = 0
[*1..n1].each do |a|
  [*1..n2].each do |b|
    tmp = b
    #p "#{a} #{b}"
    if a * b <= (N - 1)
      res += 1
      #ans << [a, b]
    else
      break
    end
  end
  n2 = tmp
end
p res
#abc = (N-1) * 2 # [*1..[*1..N-1].size].size
#p abc
#p ([*1..N-1].sum * 2) + (N / 2 - 1) + 1
=begin
res = 0
ans = []
ab=[*1..(N-1)].repeated_permutation(2).to_a

ab.each do |a, b|
  if a * b <= (N - 1)
    res += 1
    ans << [a, b]
  end
end
=end
#p ans
#p res
//  [ruby]
n = gets.to_i
pre_sieve = Array.new(n) { |i| i }
sieve = Array.new(n)
ans = 0

s = Math.sqrt(n - 1).to_i
2.upto(s) do |i|
  ((n - 1) / i).times do |j|
    pre_sieve[i * (j + 1)] = i if i < pre_sieve[i * (j + 1)]
  end
end

2.upto(n - 1) do |i|
  h = Hash.new(0)
  x = i
  while x != 1
    h[pre_sieve[x]] += 1
    x /= pre_sieve[x]
  end
  sieve[i] = h
end

2.upto(n - 1) do |i|
  x = 1
  sieve[i].each_value do |j|
    x *= (j + 1)
  end

  ans += x
end

puts ans + 1
//  [ruby]
n = gets.chomp.to_i
kazu = 0
ahigh = n
bhigh = n
for a in 1..ahigh do
    for b in 1..bhigh do
        if a * b < n then
            kazu = kazu + 1
        end
        bhigh = n / a + 1
    end
end
puts kazu
//  [rust]
#[allow(unused_imports)]
use proconio::marker::{Bytes, Chars, Usize1};
use proconio::{fastout, input};
use std::collections::HashMap;
#[fastout]
fn main() {
    input! {
        n: usize,
    }
    let mut ans = 0;
    for i in 1..n {
        let prime = trial_division(n - i);
        let mut count = 1;
        for (_, value) in prime.iter() {
            count *= value + 1;
        }
        ans += count;
    }
    println!("{}", ans);
}

fn trial_division(mut n: usize) -> HashMap<usize, usize> {
    let mut primes = HashMap::new();
    let mut i = 2;

    //  n を root n 以下の整数で割り切れるまで割っていく
    while i * i <= n {
        while n % i == 0 {
            n /= i;
            if primes.contains_key(&i) {
                let x = primes.get_mut(&i).unwrap();
                *x += 1;
            } else {
                primes.insert(i, 1);
            }
        }
        i += 1;
    }

    // 最後にnが素数になっている場合はそれ自身も素因数に含めて終了
    if n > 1 {
        if primes.contains_key(&n) {
            let x = primes.get_mut(&n).unwrap();
            *x += 1;
        } else {
            primes.insert(n, 1);
        }
    }
    primes
}