#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 *, char *, char *);
short strlen(char *);
int main() {
  FILE *f = fopen("INP.TXT", "r");
  char x[1001], y[1001], r = 0;
  short m, n, i, j = 0, z[1000][128] = {};
  fscanf(f, "%s %s", x, y);
  fclose(f);
  m = strlen(x);
  n = strlen(y);
  for (i = 0; i < n; i++)
    if ((y[i] == x[j]) && (++j == m)) {
      r = 1;
      break;
    }
  f = fopen("OUT.TXT", "w");
  fputs(r ? "YES\n" : "NO\n", f);
  fclose(f);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f000,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe87(%rip),%rdi
lea    0xe88(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x10(%rbp)
movb   $0x0,-0x7f1(%rbp)
movw   $0x0,-0x7fa(%rbp)
lea    -0x3f000(%rbp),%rdi
xor    %esi,%esi
mov    $0x3e800,%edx
call   1060 <memset@plt>
mov    -0x10(%rbp),%rdi
lea    -0x400(%rbp),%rdx
lea    -0x7f0(%rbp),%rcx
lea    0xe45(%rip),%rsi
call   1070 <fscanf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
lea    -0x400(%rbp),%rdi
call   1040 <strlen@plt>
mov    %ax,-0x7f4(%rbp)
lea    -0x7f0(%rbp),%rdi
call   1040 <strlen@plt>
mov    %ax,-0x7f6(%rbp)
movw   $0x0,-0x7f8(%rbp)
movswl -0x7f8(%rbp),%eax
movswl -0x7f6(%rbp),%ecx
cmp    %ecx,%eax
jge    128a <main+0x12a>
movswq -0x7f8(%rbp),%rax
ff
movsbl -0x7f0(%rbp,%rax,1),%eax
ff
movswq -0x7fa(%rbp),%rcx
ff
movsbl -0x400(%rbp,%rcx,1),%ecx
ff
cmp    %ecx,%eax
jne    126e <main+0x10e>
mov    -0x7fa(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x7fa(%rbp)
cwtl
movswl -0x7f4(%rbp),%ecx
cmp    %ecx,%eax
jne    126e <main+0x10e>
movb   $0x1,-0x7f1(%rbp)
jmp    128a <main+0x12a>
jmp    1273 <main+0x113>
mov    -0x7f8(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x7f8(%rbp)
jmp    1202 <main+0xa2>
lea    0xd7f(%rip),%rdi
lea    0xd80(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x10(%rbp)
movsbl -0x7f1(%rbp),%ecx
lea    0xd70(%rip),%rdi
lea    0xd64(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdi
mov    -0x10(%rbp),%rsi
call   1050 <fputs@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x3f000,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x7e0,%rsp
lea    0xe9e(%rip),%rdi
lea    0xe9f(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,%rbx
lea    0xe92(%rip),%rsi
lea    0x3f0(%rsp),%rbp
mov    %rsp,%r14
mov    %rax,%rdi
mov    %rbp,%rdx
mov    %r14,%rcx
call   1060 <fscanf@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
mov    %rbp,%rdi
call   1040 <strlen@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1040 <strlen@plt>
lea    0xe6d(%rip),%rbx
test   %ax,%ax
jle    11f5 <main+0xa5>
movzwl %ax,%eax
xor    %ecx,%ecx
lea    0xe57(%rip),%r8
xor    %esi,%esi
jmp    11d9 <main+0x89>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rcx
cmp    %rcx,%rax
je     11f5 <main+0xa5>
movzbl (%rsp,%rcx,1),%edx
movswq %si,%rdi
cmp    0x3f0(%rsp,%rdi,1),%dl
jne    11d0 <main+0x80>
add    $0x1,%esi
cmp    %bp,%si
jne    11d0 <main+0x80>
mov    %r8,%rbx
lea    0xe14(%rip),%rdi
lea    0xe15(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,%rbp
mov    %rbx,%rdi
mov    %rax,%rsi
call   1050 <fputs@plt>
mov    %rbp,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x7e0,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"INP.TXT\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [6 x i8] c"%s %s\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 [1001 x i8]
%2 = alloca [1001 x i8]
%3 = 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))
%4 = getelementptr inbounds [1001 x i8], [1001 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [1001 x i8], [1001 x i8]* %2, i64 0, i64 0
%6 = call i32 @fscanf(i32* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %4, i8* %5)
%7 = call i32 @fclose(i32* %3)
%8 = call signext i16 @strlen(i8* %4)
%9 = call signext i16 @strlen(i8* %5)
%10 = icmp sgt i16 %9, 0
br i1 %10, label %11, label %29
11: ; preds = %0
%12 = zext i16 %9 to i64
br label %13
13: ; preds = %11, %25
%14 = phi i64 [ 0, %11 ], [ %27, %25 ]
%15 = phi i16 [ 0, %11 ], [ %26, %25 ]
%16 = getelementptr inbounds [1001 x i8], [1001 x i8]* %2, i64 0, i64 %14
%17 = load i8, i8* %16
%18 = sext i16 %15 to i64
%19 = getelementptr inbounds [1001 x i8], [1001 x i8]* %1, i64 0, i64 %18
%20 = load i8, i8* %19
%21 = icmp eq i8 %17, %20
br i1 %21, label %22, label %25
22: ; preds = %13
%23 = add i16 %15, 1
%24 = icmp eq i16 %23, %8
br i1 %24, label %29, label %25
25: ; preds = %13, %22
%26 = phi i16 [ %23, %22 ], [ %15, %13 ]
%27 = add nuw nsw i64 %14, 1
%28 = icmp eq i64 %27, %12
br i1 %28, label %29, label %13
29: ; preds = %25, %22, %0
%30 = phi i8* [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), %0 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), %22 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), %25 ]
%31 = 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))
%32 = call i32 @fputs(i8* %30, i32* %31)
%33 = call i32 @fclose(i32* %31)
ret i32 0
}