#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 c_less_n(char *, char, int, int);
int check_substr(char *, char *, int, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  char s1[100], s2[100], ch;
  int n, i, j;
  scanf("%s ", s1);
  scanf("%c", &ch);
  scanf("%d", &n);
  scanf("%s", s2);
  i = check_substr(s1, s2, 100, 100);
  j = c_less_n(s1, ch, 100, n);
  if ((i == 1 && j == 0) || (i == 0 && j == 1))
    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    0xea3(%rip),%rdi
mov    $0x0,%al
call   1060 <scanf@plt>
lea    0xe99(%rip),%rdi
lea    -0xe1(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
lea    0xe87(%rip),%rdi
lea    -0xe8(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
lea    -0xe0(%rbp),%rsi
lea    0xe6e(%rip),%rdi
mov    $0x0,%al
call   1060 <scanf@plt>
lea    -0x70(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
mov    $0x64,%ecx
mov    %ecx,%edx
call   1050 <check_substr@plt>
mov    %eax,-0xec(%rbp)
lea    -0x70(%rbp),%rdi
mov    -0xe1(%rbp),%al
mov    -0xe8(%rbp),%ecx
mov    $0x64,%edx
movsbl %al,%esi
call   1040 <c_less_n@plt>
mov    %eax,-0xf0(%rbp)
cmpl   $0x1,-0xec(%rbp)
jne    11fd <main+0xbd>
cmpl   $0x0,-0xf0(%rbp)
je     1217 <main+0xd7>
cmpl   $0x0,-0xec(%rbp)
jne    1228 <main+0xe8>
cmpl   $0x1,-0xf0(%rbp)
jne    1228 <main+0xe8>
lea    0xdef(%rip),%rdi
call   1030 <printf@plt>
jmp    1234 <main+0xf4>
lea    0xde2(%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    0x80(%rsp),%r14
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0xe9a(%rip),%rdi
lea    0xb(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0xe8a(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0xe7a(%rip),%rdi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x64,%edx
mov    $0x64,%ecx
call   1050 <check_substr@plt>
mov    %eax,%ebx
movsbl 0xb(%rsp),%esi
mov    0xc(%rsp),%ecx
mov    %r14,%rdi
mov    $0x64,%edx
call   1040 <c_less_n@plt>
mov    %ebx,%ecx
xor    $0x1,%ecx
mov    %eax,%edx
xor    $0x1,%edx
lea    0xe30(%rip),%rsi
lea    0xe2d(%rip),%rdi
or     %ebx,%edx
cmove  %rsi,%rdi
or     %eax,%ecx
cmove  %rsi,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xe8,%rsp
pop    %rbx
pop    %r14
ret

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

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