#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, ...);
int main() {
  FILE *f = fopen("INP.TXT", "r");
  unsigned long long n;
  long long a, b, c;
  char s[5] = {89, 69, 83, 10};
  fscanf(f, "%lld", &n);
  if (n > 2) {
    fscanf(f, "%lld %lld", &a, &b);
    c = b - a;
    for (n -= 2; n; n--) {
      a = b;
      fscanf(f, "%lld", &b);
      if (a - b + c) {
        s[0] = 78;
        s[1] = 79;
        s[2] = 10;
        s[3] = 0;
        break;
      }
    }
  }
  fclose(f);
  f = fopen("OUT.TXT", "w");
  fputs(s, f);
  fclose(f);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
lea    0xeab(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    0xe9e(%rip),%eax
mov    %eax,-0x35(%rbp)
mov    0xe99(%rip),%al
mov    %al,-0x31(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe91(%rip),%rsi
lea    -0x18(%rbp),%rdx
mov    $0x0,%al
call   1050 <fscanf@plt>
cmpq   $0x2,-0x18(%rbp)
jbe    123a <main+0xfa>
mov    -0x10(%rbp),%rdi
lea    0xe6b(%rip),%rsi
lea    -0x20(%rbp),%rdx
lea    -0x28(%rbp),%rcx
mov    $0x0,%al
call   1050 <fscanf@plt>
mov    -0x28(%rbp),%rax
sub    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
sub    $0x2,%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1235 <main+0xf5>
mov    -0x28(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe2b(%rip),%rsi
lea    -0x28(%rbp),%rdx
mov    $0x0,%al
call   1050 <fscanf@plt>
mov    -0x20(%rbp),%rax
sub    -0x28(%rbp),%rax
add    -0x30(%rbp),%rax
cmp    $0x0,%rax
je     121f <main+0xdf>
movb   $0x4e,-0x35(%rbp)
movb   $0x4f,-0x34(%rbp)
movb   $0xa,-0x33(%rbp)
movb   $0x0,-0x32(%rbp)
jmp    1235 <main+0xf5>
jmp    1224 <main+0xe4>
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
jmp    11cb <main+0x8b>
jmp    123a <main+0xfa>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
lea    0xdcf(%rip),%rdi
lea    0xdd0(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x10(%rbp)
lea    -0x35(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <fputs@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x28,%rsp
lea    0xeae(%rip),%rdi
lea    0xeaf(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%r12
movb   $0x0,0xc(%rsp)
movl   $0xa534559,0x8(%rsp)
0a
lea    0xe9f(%rip),%rsi
lea    0x20(%rsp),%rdx
mov    %rax,%rdi
xor    %eax,%eax
call   1050 <fscanf@plt>
cmpq   $0x3,0x20(%rsp)
jb     1209 <main+0xc9>
lea    0xe7c(%rip),%rsi
lea    0x18(%rsp),%rdx
lea    0x10(%rsp),%rcx
mov    %r12,%rdi
xor    %eax,%eax
call   1050 <fscanf@plt>
mov    0x10(%rsp),%rax
mov    0x18(%rsp),%rbx
addq   $0xfffffffffffffffe,0x20(%rsp)
je     1209 <main+0xc9>
sub    %rax,%rbx
lea    0xe51(%rip),%r14
lea    0x10(%rsp),%r15
nopl   0x0(%rax,%rax,1)
mov    %rax,0x18(%rsp)
mov    %r12,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1050 <fscanf@plt>
mov    0x18(%rsp),%rcx
mov    0x10(%rsp),%rax
sub    %rax,%rcx
cmp    %rbx,%rcx
jne    1201 <main+0xc1>
addq   $0xffffffffffffffff,0x20(%rsp)
jne    11d0 <main+0x90>
jmp    1209 <main+0xc9>
movl   $0xa4f4e,0x8(%rsp)
mov    %r12,%rdi
call   1030 <fclose@plt>
lea    0xe01(%rip),%rdi
lea    0xe02(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%rbx
lea    0x8(%rsp),%rdi
mov    %rax,%rsi
call   1040 <fputs@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [8 x i8] c"INP.TXT\00"
@.str.1 = [2 x i8] c"r\00"
@__const.main.s = [5 x i8] c"YES\0A\00"
@.str.2 = [5 x i8] c"%lld\00"
@.str.3 = [10 x i8] c"%lld %lld\00"
@.str.4 = [8 x i8] c"OUT.TXT\00"
@.str.5 = [2 x i8] c"w\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca [5 x i8]
store i32 0, i32* %1
%8 = call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %8, i32** %2
%9 = bitcast [5 x i8]* %7 to i8*
%10 = load i32*, i32** %2
%11 = call i32 (i32*, i8*, ...) @fscanf(i32* %10, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i64* %3)
%12 = load i64, i64* %3
%13 = icmp ugt i64 %12, 2
br i1 %13, label %14, label %45
14: ; preds = %0
%15 = load i32*, i32** %2
%16 = call i32 (i32*, i8*, ...) @fscanf(i32* %15, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i64* %4, i64* %5)
%17 = load i64, i64* %5
%18 = load i64, i64* %4
%19 = sub nsw i64 %17, %18
store i64 %19, i64* %6
%20 = load i64, i64* %3
%21 = sub i64 %20, 2
store i64 %21, i64* %3
br label %22
22: ; preds = %41, %14
%23 = load i64, i64* %3
%24 = icmp ne i64 %23, 0
br i1 %24, label %25, label %44
25: ; preds = %22
%26 = load i64, i64* %5
store i64 %26, i64* %4
%27 = load i32*, i32** %2
%28 = call i32 (i32*, i8*, ...) @fscanf(i32* %27, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i64* %5)
%29 = load i64, i64* %4
%30 = load i64, i64* %5
%31 = sub nsw i64 %29, %30
%32 = load i64, i64* %6
%33 = add nsw i64 %31, %32
%34 = icmp ne i64 %33, 0
br i1 %34, label %35, label %40
35: ; preds = %25
%36 = getelementptr inbounds [5 x i8], [5 x i8]* %7, i64 0, i64 0
store i8 78, i8* %36
%37 = getelementptr inbounds [5 x i8], [5 x i8]* %7, i64 0, i64 1
store i8 79, i8* %37
%38 = getelementptr inbounds [5 x i8], [5 x i8]* %7, i64 0, i64 2
store i8 10, i8* %38
%39 = getelementptr inbounds [5 x i8], [5 x i8]* %7, i64 0, i64 3
store i8 0, i8* %39
br label %44
40: ; preds = %25
br label %41
41: ; preds = %40
%42 = load i64, i64* %3
%43 = add i64 %42, -1
store i64 %43, i64* %3
br label %22
44: ; preds = %35, %22
br label %45
45: ; preds = %44, %0
%46 = load i32*, i32** %2
%47 = call i32 @fclose(i32* %46)
%48 = call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
store i32* %48, i32** %2
%49 = getelementptr inbounds [5 x i8], [5 x i8]* %7, i64 0, i64 0
%50 = load i32*, i32** %2
%51 = call i32 @fputs(i8* %49, i32* %50)
%52 = load i32*, i32** %2
%53 = call i32 @fclose(i32* %52)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"INP.TXT\00"
@.str.1 = [2 x i8] c"r\00"
@__const.main.s = [5 x i8] c"YES\0A\00"
@.str.2 = [5 x i8] c"%lld\00"
@.str.3 = [10 x i8] c"%lld %lld\00"
@.str.4 = [8 x i8] c"OUT.TXT\00"
@.str.5 = [2 x i8] c"w\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i64
%4 = alloca [5 x i8]
%5 = tail call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%6 = bitcast i64* %1 to i8*
%7 = bitcast i64* %2 to i8*
%8 = bitcast i64* %3 to i8*
%9 = getelementptr inbounds [5 x i8], [5 x i8]* %4, i64 0, i64 0
%10 = call i32 (i32*, i8*, ...) @fscanf(i32* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i64* %1)
%11 = load i64, i64* %1
%12 = icmp ugt i64 %11, 2
br i1 %12, label %13, label %36
13: ; preds = %0
%14 = call i32 (i32*, i8*, ...) @fscanf(i32* %5, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i64* %2, i64* %3)
%15 = load i64, i64* %3
%16 = load i64, i64* %2
%17 = sub i64 %16, %15
%18 = load i64, i64* %1
%19 = add i64 %18, -2
store i64 %19, i64* %1
%20 = icmp eq i64 %19, 0
br i1 %20, label %36, label %21
21: ; preds = %13, %32
%22 = phi i64 [ %25, %32 ], [ %15, %13 ]
store i64 %22, i64* %2
%23 = call i32 (i32*, i8*, ...) @fscanf(i32* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i64* %3)
%24 = load i64, i64* %2
%25 = load i64, i64* %3
%26 = sub nsw i64 %24, %25
%27 = icmp eq i64 %26, %17
br i1 %27, label %32, label %28
28: ; preds = %21
store i8 78, i8* %9
%29 = getelementptr inbounds [5 x i8], [5 x i8]* %4, i64 0, i64 1
store i8 79, i8* %29
%30 = getelementptr inbounds [5 x i8], [5 x i8]* %4, i64 0, i64 2
store i8 10, i8* %30
%31 = getelementptr inbounds [5 x i8], [5 x i8]* %4, i64 0, i64 3
store i8 0, i8* %31
br label %36
32: ; preds = %21
%33 = load i64, i64* %1
%34 = add i64 %33, -1
store i64 %34, i64* %1
%35 = icmp eq i64 %34, 0
br i1 %35, label %36, label %21
36: ; preds = %32, %13, %28, %0
%37 = call i32 @fclose(i32* %5)
%38 = call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%39 = call i32 @fputs(i8* %9, i32* %38)
%40 = call i32 @fclose(i32* %38)
ret i32 0
}