#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 less_than_n(char *, int, char);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *, char *, int *, char *);
int search(char *, char *);
int main() {
  char s1[101], s2[101], c;
  int n;
  scanf("%s %c %d %s", s1, &c, &n, s2);
  if (((search(s1, s2) == 0) && (less_than_n(s1, n, c) == 1)) ||
      ((search(s1, s2) == 1) && (less_than_n(s1, n, c) == 0))) {
    printf("YES");
  } else {
    printf("NO");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rsi
lea    -0xe0(%rbp),%r8
lea    0xe9c(%rip),%rdi
lea    -0xe1(%rbp),%rdx
lea    -0xe8(%rbp),%rcx
call   1060 <scanf@plt>
lea    -0x70(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
call   1040 <search@plt>
cmp    $0x0,%eax
jne    11af <main+0x6f>
lea    -0x70(%rbp),%rdi
mov    -0xe8(%rbp),%esi
movsbl -0xe1(%rbp),%edx
call   1050 <less_than_n@plt>
cmp    $0x1,%eax
je     11e7 <main+0xa7>
lea    -0x70(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
call   1040 <search@plt>
cmp    $0x1,%eax
jne    11f8 <main+0xb8>
lea    -0x70(%rbp),%rdi
mov    -0xe8(%rbp),%esi
movsbl -0xe1(%rbp),%edx
call   1050 <less_than_n@plt>
cmp    $0x0,%eax
jne    11f8 <main+0xb8>
lea    0xe1e(%rip),%rdi
call   1030 <printf@plt>
jmp    1204 <main+0xc4>
lea    0xe11(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0xe8,%rsp
lea    0xeaf(%rip),%rdi
lea    0x10(%rsp),%r14
lea    0xb(%rsp),%rdx
lea    0xc(%rsp),%rcx
lea    0x80(%rsp),%rbx
mov    %r14,%rsi
mov    %rbx,%r8
call   1060 <scanf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <search@plt>
test   %eax,%eax
jne    119a <main+0x5a>
mov    0xc(%rsp),%esi
movsbl 0xb(%rsp),%edx
lea    0x10(%rsp),%rdi
call   1050 <less_than_n@plt>
cmp    $0x1,%eax
je     11d1 <main+0x91>
lea    0x10(%rsp),%rdi
lea    0x80(%rsp),%rsi
call   1040 <search@plt>
cmp    $0x1,%eax
jne    11c8 <main+0x88>
mov    0xc(%rsp),%esi
movsbl 0xb(%rsp),%edx
lea    0x10(%rsp),%rdi
call   1050 <less_than_n@plt>
test   %eax,%eax
je     11d1 <main+0x91>
lea    0xe41(%rip),%rdi
jmp    11d8 <main+0x98>
lea    0xe34(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xe8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [12 x i8] c"%s %c %d %s\00"
@.str.1 = [4 x i8] c"YES\00"
@.str.2 = [3 x i8] c"NO\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [101 x i8]
%3 = alloca [101 x i8]
%4 = alloca i8
%5 = alloca i32
store i32 0, i32* %1
%6 = getelementptr inbounds [101 x i8], [101 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [101 x i8], [101 x i8]* %3, i64 0, i64 0
%8 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %4, i32* %5, i8* %7)
%9 = getelementptr inbounds [101 x i8], [101 x i8]* %2, i64 0, i64 0
%10 = getelementptr inbounds [101 x i8], [101 x i8]* %3, i64 0, i64 0
%11 = call i32 @search(i8* %9, i8* %10)
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %19
13: ; preds = %0
%14 = getelementptr inbounds [101 x i8], [101 x i8]* %2, i64 0, i64 0
%15 = load i32, i32* %5
%16 = load i8, i8* %4
%17 = call i32 @less_than_n(i8* %14, i32 %15, i8 signext %16)
%18 = icmp eq i32 %17, 1
br i1 %18, label %30, label %19
19: ; preds = %13, %0
%20 = getelementptr inbounds [101 x i8], [101 x i8]* %2, i64 0, i64 0
%21 = getelementptr inbounds [101 x i8], [101 x i8]* %3, i64 0, i64 0
%22 = call i32 @search(i8* %20, i8* %21)
%23 = icmp eq i32 %22, 1
br i1 %23, label %24, label %32
24: ; preds = %19
%25 = getelementptr inbounds [101 x i8], [101 x i8]* %2, i64 0, i64 0
%26 = load i32, i32* %5
%27 = load i8, i8* %4
%28 = call i32 @less_than_n(i8* %25, i32 %26, i8 signext %27)
%29 = icmp eq i32 %28, 0
br i1 %29, label %30, label %32
30: ; preds = %24, %13
%31 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %34
32: ; preds = %24, %19
%33 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %34
34: ; preds = %32, %30
ret i32 0
}

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