#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 *, short *);
int main() {
  FILE *f = fopen("INP.TXT", "r");
  short n, i, a;
  char b[10000] = {};
  fscanf(f, "%hd", &n);
  for (i = 0; i < n; i++) {
    fscanf(f, "%hd", &a);
    if (a <= n)
      b[a - 1] = 1;
  }
  fclose(f);
  a = 1;
  for (i = 0; i < n; i++)
    if (!b[i]) {
      a = 0;
      break;
    }
  f = fopen("OUT.TXT", "w");
  fputs(a ? "YES\n" : "NO\n", f);
  fclose(f);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2730,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe97(%rip),%rdi
lea    0xe98(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x10(%rbp)
lea    -0x2730(%rbp),%rdi
xor    %esi,%esi
mov    $0x2710,%edx
call   1050 <memset@plt>
mov    -0x10(%rbp),%rdi
lea    0xe73(%rip),%rsi
lea    -0x12(%rbp),%rdx
call   1060 <fscanf@plt>
movw   $0x0,-0x14(%rbp)
movswl -0x14(%rbp),%eax
movswl -0x12(%rbp),%ecx
cmp    %ecx,%eax
jge    1201 <main+0xb1>
mov    -0x10(%rbp),%rdi
lea    0xe49(%rip),%rsi
lea    -0x16(%rbp),%rdx
call   1060 <fscanf@plt>
movswl -0x16(%rbp),%eax
movswl -0x12(%rbp),%ecx
cmp    %ecx,%eax
jg     11eb <main+0x9b>
movswl -0x16(%rbp),%eax
sub    $0x1,%eax
cltq
movb   $0x1,-0x2730(%rbp,%rax,1)
01
jmp    11f0 <main+0xa0>
mov    -0x14(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x14(%rbp)
jmp    11a6 <main+0x56>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
movw   $0x1,-0x16(%rbp)
movw   $0x0,-0x14(%rbp)
movswl -0x14(%rbp),%eax
movswl -0x12(%rbp),%ecx
cmp    %ecx,%eax
jge    125a <main+0x10a>
movswq -0x14(%rbp),%rax
cmpb   $0x0,-0x2730(%rbp,%rax,1)
jne    1244 <main+0xf4>
movw   $0x0,-0x16(%rbp)
jmp    125a <main+0x10a>
jmp    1249 <main+0xf9>
mov    -0x14(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x14(%rbp)
jmp    1216 <main+0xc6>
lea    0xdad(%rip),%rdi
lea    0xdae(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x10(%rbp)
movswl -0x16(%rbp),%ecx
lea    0xda1(%rip),%rdi
lea    0xd95(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdi
mov    -0x10(%rbp),%rsi
call   1040 <fputs@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x2730,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x2720,%rsp
lea    0xe9a(%rip),%rdi
lea    0xe9b(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,%rbx
lea    0x10(%rsp),%r14
mov    $0x2710,%edx
mov    %r14,%rdi
xor    %esi,%esi
call   1050 <memset@plt>
lea    0xe7a(%rip),%rsi
lea    0xe(%rsp),%rdx
mov    %rbx,%rdi
call   1060 <fscanf@plt>
cmpw   $0x0,0xe(%rsp)
jle    11ee <main+0x9e>
xor    %ebp,%ebp
lea    0xe5c(%rip),%r15
lea    0xc(%rsp),%r12
jmp    11c8 <main+0x78>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%ebp
cmp    %ax,%bp
jge    11ee <main+0x9e>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1060 <fscanf@plt>
movswq 0xc(%rsp),%rcx
movzwl 0xe(%rsp),%eax
cmp    %ax,%cx
jg     11c0 <main+0x70>
movb   $0x1,-0x1(%rcx,%r14,1)
jmp    11c0 <main+0x70>
mov    %rbx,%rdi
call   1030 <fclose@plt>
movw   $0x1,0xc(%rsp)
movzwl 0xe(%rsp),%eax
test   %ax,%ax
jle    1229 <main+0xd9>
xor    %ecx,%ecx
nopl   0x0(%rax)
cmpb   $0x0,0x10(%rsp,%rcx,1)
je     1222 <main+0xd2>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1210 <main+0xc0>
jmp    1229 <main+0xd9>
movw   $0x0,0xc(%rsp)
lea    0xdde(%rip),%rdi
lea    0xddf(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,%rbx
cmpw   $0x0,0xc(%rsp)
lea    0xdd1(%rip),%rax
lea    0xdc5(%rip),%rdi
cmove  %rax,%rdi
mov    %rbx,%rsi
call   1040 <fputs@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x2720,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"INP.TXT\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [4 x i8] c"%hd\00"
@.str.3 = [8 x i8] c"OUT.TXT\00"
@.str.4 = [2 x i8] c"w\00"
@.str.5 = [5 x i8] c"YES\0A\00"
@.str.6 = [4 x i8] c"NO\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i16
%4 = alloca i16
%5 = alloca i16
%6 = alloca [10000 x i8]
store i32 0, i32* %1
%7 = 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* %7, i32** %2
%8 = bitcast [10000 x i8]* %6 to i8*
%9 = load i32*, i32** %2
%10 = call i32 @fscanf(i32* %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i16* %3)
store i16 0, i16* %4
br label %11
11: ; preds = %32, %0
%12 = load i16, i16* %4
%13 = sext i16 %12 to i32
%14 = load i16, i16* %3
%15 = sext i16 %14 to i32
%16 = icmp slt i32 %13, %15
br i1 %16, label %17, label %35
17: ; preds = %11
%18 = load i32*, i32** %2
%19 = call i32 @fscanf(i32* %18, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i16* %5)
%20 = load i16, i16* %5
%21 = sext i16 %20 to i32
%22 = load i16, i16* %3
%23 = sext i16 %22 to i32
%24 = icmp sle i32 %21, %23
br i1 %24, label %25, label %31
25: ; preds = %17
%26 = load i16, i16* %5
%27 = sext i16 %26 to i32
%28 = sub nsw i32 %27, 1
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [10000 x i8], [10000 x i8]* %6, i64 0, i64 %29
store i8 1, i8* %30
br label %31
31: ; preds = %25, %17
br label %32
32: ; preds = %31
%33 = load i16, i16* %4
%34 = add i16 %33, 1
store i16 %34, i16* %4
br label %11
35: ; preds = %11
%36 = load i32*, i32** %2
%37 = call i32 @fclose(i32* %36)
store i16 1, i16* %5
store i16 0, i16* %4
br label %38
38: ; preds = %52, %35
%39 = load i16, i16* %4
%40 = sext i16 %39 to i32
%41 = load i16, i16* %3
%42 = sext i16 %41 to i32
%43 = icmp slt i32 %40, %42
br i1 %43, label %44, label %55
44: ; preds = %38
%45 = load i16, i16* %4
%46 = sext i16 %45 to i64
%47 = getelementptr inbounds [10000 x i8], [10000 x i8]* %6, i64 0, i64 %46
%48 = load i8, i8* %47
%49 = icmp ne i8 %48, 0
br i1 %49, label %51, label %50
50: ; preds = %44
store i16 0, i16* %5
br label %55
51: ; preds = %44
br label %52
52: ; preds = %51
%53 = load i16, i16* %4
%54 = add i16 %53, 1
store i16 %54, i16* %4
br label %38
55: ; preds = %50, %38
%56 = call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i32* %56, i32** %2
%57 = load i16, i16* %5
%58 = sext i16 %57 to i32
%59 = icmp ne i32 %58, 0
%60 = zext i1 %59 to i64
%61 = select i1 %59, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0)
%62 = load i32*, i32** %2
%63 = call i32 @fputs(i8* %61, i32* %62)
%64 = load i32*, i32** %2
%65 = call i32 @fclose(i32* %64)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"INP.TXT\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [4 x i8] c"%hd\00"
@.str.3 = [8 x i8] c"OUT.TXT\00"
@.str.4 = [2 x i8] c"w\00"
@.str.5 = [5 x i8] c"YES\0A\00"
@.str.6 = [4 x i8] c"NO\0A\00"
define i32 @main() {
%1 = alloca i16
%2 = alloca i16
%3 = alloca [10000 x i8]
%4 = 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))
%5 = bitcast i16* %1 to i8*
%6 = bitcast i16* %2 to i8*
%7 = getelementptr inbounds [10000 x i8], [10000 x i8]* %3, i64 0, i64 0
%8 = call i32 @fscanf(i32* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i16* %1)
%9 = load i16, i16* %1
%10 = icmp sgt i16 %9, 0
br i1 %10, label %11, label %24
11: ; preds = %0, %21
%12 = phi i16 [ %22, %21 ], [ 0, %0 ]
%13 = call i32 @fscanf(i32* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i16* %2)
%14 = load i16, i16* %2
%15 = load i16, i16* %1
%16 = icmp sgt i16 %14, %15
br i1 %16, label %21, label %17
17: ; preds = %11
%18 = sext i16 %14 to i64
%19 = add nsw i64 %18, -1
%20 = getelementptr inbounds [10000 x i8], [10000 x i8]* %3, i64 0, i64 %19
store i8 1, i8* %20
br label %21
21: ; preds = %11, %17
%22 = add nuw nsw i16 %12, 1
%23 = icmp slt i16 %22, %15
br i1 %23, label %11, label %24
24: ; preds = %21, %0
%25 = call i32 @fclose(i32* %4)
store i16 1, i16* %2
%26 = load i16, i16* %1
%27 = icmp sgt i16 %26, 0
br i1 %27, label %28, label %39
28: ; preds = %24
%29 = zext i16 %26 to i64
br label %32
30: ; preds = %32
%31 = icmp eq i64 %37, %29
br i1 %31, label %39, label %32
32: ; preds = %28, %30
%33 = phi i64 [ 0, %28 ], [ %37, %30 ]
%34 = getelementptr inbounds [10000 x i8], [10000 x i8]* %3, i64 0, i64 %33
%35 = load i8, i8* %34
%36 = icmp eq i8 %35, 0
%37 = add nuw nsw i64 %33, 1
br i1 %36, label %38, label %30
38: ; preds = %32
store i16 0, i16* %2
br label %39
39: ; preds = %30, %24, %38
%40 = call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%41 = load i16, i16* %2
%42 = icmp eq i16 %41, 0
%43 = select i1 %42, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0)
%44 = call i32 @fputs(i8* %43, i32* %40)
%45 = call i32 @fclose(i32* %40)
ret i32 0
}