#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int check_safe(int **);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *, ...);
int main() {
  int mat[8][8];
  for (int i = 0; i < 8; i++) {
    for (int j = 0; j < 8; j++) {
      mat[i][j] = 0;
    }
  }
  int N, r, c;
  scanf("%d", &N);
  for (int i = 0; i < N; i++) {
    scanf("%d %d", &r, &c);
    mat[r][c] = 1;
  }
  int flag = check_safe(mat);
  if (flag == 1)
    printf("no");
  else
    printf("yes");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x114(%rbp)
cmpl   $0x8,-0x114(%rbp)
jge    11c0 <main+0x90>
movl   $0x0,-0x118(%rbp)
cmpl   $0x8,-0x118(%rbp)
jge    11a7 <main+0x77>
movslq -0x114(%rbp),%rcx
lea    -0x110(%rbp),%rax
shl    $0x5,%rcx
add    %rcx,%rax
movslq -0x118(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x118(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x118(%rbp)
jmp    1163 <main+0x33>
jmp    11ac <main+0x7c>
mov    -0x114(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x114(%rbp)
jmp    114c <main+0x1c>
lea    0xe3c(%rip),%rdi
lea    -0x11c(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x0,-0x128(%rbp)
mov    -0x128(%rbp),%eax
cmp    -0x11c(%rbp),%eax
jge    1244 <main+0x114>
lea    0xe08(%rip),%rdi
lea    -0x120(%rbp),%rsi
lea    -0x124(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
movslq -0x120(%rbp),%rcx
lea    -0x110(%rbp),%rax
shl    $0x5,%rcx
add    %rcx,%rax
movslq -0x124(%rbp),%rcx
movl   $0x1,(%rax,%rcx,4)
mov    -0x128(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x128(%rbp)
jmp    11df <main+0xaf>
lea    -0x110(%rbp),%rdi
call   1050 <check_safe@plt>
mov    %eax,-0x12c(%rbp)
cmpl   $0x1,-0x12c(%rbp)
jne    1274 <main+0x144>
lea    0xd9c(%rip),%rdi
call   1030 <printf@plt>
jmp    1280 <main+0x150>
lea    0xd8e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x130,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x118,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x100(%rsp)
movaps %xmm0,0xf0(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
lea    0xe51(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
jle    1215 <main+0xe5>
lea    0xe34(%rip),%r14
lea    0xc(%rsp),%r15
lea    0x8(%rsp),%rbx
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <scanf@plt>
movslq 0xc(%rsp),%rax
movslq 0x8(%rsp),%rcx
shl    $0x5,%rax
add    %rsp,%rax
add    $0x10,%rax
movl   $0x1,(%rax,%rcx,4)
add    $0x1,%ebp
cmp    0x4(%rsp),%ebp
jl     11e0 <main+0xb0>
lea    0x10(%rsp),%rdi
call   1050 <check_safe@plt>
cmp    $0x1,%eax
lea    0xddd(%rip),%rax
lea    0xdd9(%rip),%rdi
cmove  %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x118,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [3 x i8] c"no\00"
@.str.3 = [4 x i8] c"yes\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x [8 x i32]]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
br label %10
10: ; preds = %28, %0
%11 = load i32, i32* %3
%12 = icmp slt i32 %11, 8
br i1 %12, label %13, label %31
13: ; preds = %10
store i32 0, i32* %4
br label %14
14: ; preds = %24, %13
%15 = load i32, i32* %4
%16 = icmp slt i32 %15, 8
br i1 %16, label %17, label %27
17: ; preds = %14
%18 = load i32, i32* %3
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %2, i64 0, i64 %19
%21 = load i32, i32* %4
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [8 x i32], [8 x i32]* %20, i64 0, i64 %22
store i32 0, i32* %23
br label %24
24: ; preds = %17
%25 = load i32, i32* %4
%26 = add nsw i32 %25, 1
store i32 %26, i32* %4
br label %14
27: ; preds = %14
br label %28
28: ; preds = %27
%29 = load i32, i32* %3
%30 = add nsw i32 %29, 1
store i32 %30, i32* %3
br label %10
31: ; preds = %10
%32 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %5)
store i32 0, i32* %8
br label %33
33: ; preds = %45, %31
%34 = load i32, i32* %8
%35 = load i32, i32* %5
%36 = icmp slt i32 %34, %35
br i1 %36, label %37, label %48
37: ; preds = %33
%38 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %6, i32* %7)
%39 = load i32, i32* %6
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %2, i64 0, i64 %40
%42 = load i32, i32* %7
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [8 x i32], [8 x i32]* %41, i64 0, i64 %43
store i32 1, i32* %44
br label %45
45: ; preds = %37
%46 = load i32, i32* %8
%47 = add nsw i32 %46, 1
store i32 %47, i32* %8
br label %33
48: ; preds = %33
%49 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %2, i64 0, i64 0
%50 = bitcast [8 x i32]* %49 to i32**
%51 = call i32 @check_safe(i32** %50)
store i32 %51, i32* %9
%52 = load i32, i32* %9
%53 = icmp eq i32 %52, 1
br i1 %53, label %54, label %56
54: ; preds = %48
%55 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %58
56: ; preds = %48
%57 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
br label %58
58: ; preds = %56, %54
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [3 x i8] c"no\00"
@.str.3 = [4 x i8] c"yes\00"
define i32 @main() {
%1 = alloca [8 x [8 x i32]]
%2 = bitcast [8 x [8 x i32]]* %1 to i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %3 to i8*
%7 = bitcast i32* %4 to i8*
%8 = bitcast i32* %5 to i8*
%9 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%10 = load i32, i32* %3
%11 = icmp sgt i32 %10, 0
br i1 %11, label %18, label %12
12: ; preds = %18, %0
%13 = bitcast [8 x [8 x i32]]* %1 to i32**
%14 = call i32 @check_safe(i32** %13)
%15 = icmp eq i32 %14, 1
%16 = select i1 %15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0)
%17 = call i32 @printf(i8* dereferenceable(1) %16)
ret i32 0
18: ; preds = %0, %18
%19 = phi i32 [ %26, %18 ], [ 0, %0 ]
%20 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %4, i32* %5)
%21 = load i32, i32* %4
%22 = sext i32 %21 to i64
%23 = load i32, i32* %5
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %1, i64 0, i64 %22, i64 %24
store i32 1, i32* %25
%26 = add nuw nsw i32 %19, 1
%27 = load i32, i32* %3
%28 = icmp slt i32 %26, %27
br i1 %28, label %18, label %12
}