#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 check_char(char *, int, char, int);
int length(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  int n, i;
  char ch;
  char str[101];
  char sub[101];
  scanf("%s ", str);
  scanf("%c", &ch);
  scanf("%d", &n);
  scanf("%s ", sub);
  int l1 = length(str);
  int l2 = length(sub);
  int flag2 = 0;
  int flag1 = check_char(str, l1, ch, n);
  int j;
  for (i = 0; i <= l1 - l2; i++) {
    if (str[i] == sub[0]) {
      for (j = 0; j < l2; j++) {
        if (str[i + j] == sub[j])
          flag2 = 1;
        else
          flag2 = 0;
      }
    }
    if (flag2 == 1)
      break;
  }
  if ((flag1 + flag2) == 1)
    printf("YES");
  else
    printf("NO");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x80(%rbp),%rsi
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1060 <scanf@plt>
lea    0xe99(%rip),%rdi
lea    -0xd(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
lea    0xe8a(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
lea    -0xf0(%rbp),%rsi
lea    0xe6a(%rip),%rdi
mov    $0x0,%al
call   1060 <scanf@plt>
lea    -0x80(%rbp),%rdi
call   1030 <length@plt>
mov    %eax,-0xf4(%rbp)
lea    -0xf0(%rbp),%rdi
call   1030 <length@plt>
mov    %eax,-0xf8(%rbp)
movl   $0x0,-0xfc(%rbp)
lea    -0x80(%rbp),%rdi
mov    -0xf4(%rbp),%esi
mov    -0xd(%rbp),%al
mov    -0x8(%rbp),%ecx
movsbl %al,%edx
call   1050 <check_char@plt>
mov    %eax,-0x100(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0xf4(%rbp),%ecx
sub    -0xf8(%rbp),%ecx
cmp    %ecx,%eax
jg     12bb <main+0x17b>
movslq -0xc(%rbp),%rax
movsbl -0x80(%rbp,%rax,1),%eax
movsbl -0xf0(%rbp),%ecx
cmp    %ecx,%eax
jne    1296 <main+0x156>
movl   $0x0,-0x104(%rbp)
mov    -0x104(%rbp),%eax
cmp    -0xf8(%rbp),%eax
jge    1291 <main+0x151>
mov    -0xc(%rbp),%eax
add    -0x104(%rbp),%eax
cltq
movsbl -0x80(%rbp,%rax,1),%eax
movslq -0x104(%rbp),%rcx
movsbl -0xf0(%rbp,%rcx,1),%ecx
ff
cmp    %ecx,%eax
jne    126e <main+0x12e>
movl   $0x1,-0xfc(%rbp)
jmp    1278 <main+0x138>
movl   $0x0,-0xfc(%rbp)
jmp    127d <main+0x13d>
mov    -0x104(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x104(%rbp)
jmp    1226 <main+0xe6>
jmp    1296 <main+0x156>
cmpl   $0x1,-0xfc(%rbp)
jne    12a8 <main+0x168>
jmp    12bb <main+0x17b>
jmp    12ad <main+0x16d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11ed <main+0xad>
mov    -0x100(%rbp),%eax
add    -0xfc(%rbp),%eax
cmp    $0x1,%eax
jne    12e1 <main+0x1a1>
lea    0xd33(%rip),%rdi
call   1040 <printf@plt>
jmp    12ed <main+0x1ad>
lea    0xd26(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0xe8,%rsp
lea    0xeac(%rip),%rbx
xor    %ebp,%ebp
lea    0x80(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0xe92(%rip),%rdi
lea    0xb(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0xe82(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0x10(%rsp),%r15
mov    %rbx,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    %r14,%rdi
call   1030 <length@plt>
mov    %eax,%ebx
mov    %r15,%rdi
call   1030 <length@plt>
mov    %eax,%r15d
movsbl 0xb(%rsp),%edx
mov    0xc(%rsp),%ecx
mov    %r14,%rdi
mov    %ebx,%esi
call   1050 <check_char@plt>
sub    %r15d,%ebx
jl     1204 <main+0xc4>
mov    0x10(%rsp),%sil
lea    -0x1(%r15),%edx
add    $0x1,%ebx
jmp    11ea <main+0xaa>
xchg   %ax,%ax
add    $0x1,%r14
add    $0xffffffffffffffff,%rbx
je     1204 <main+0xc4>
cmp    %sil,(%r14)
jne    11e0 <main+0xa0>
test   %r15d,%r15d
jle    11e0 <main+0xa0>
movzbl (%r14,%rdx,1),%ecx
cmp    0x10(%rsp,%rdx,1),%cl
jne    11e0 <main+0xa0>
mov    $0x1,%ebp
add    %eax,%ebp
cmp    $0x1,%ebp
lea    0xdfa(%rip),%rax
lea    0xdf7(%rip),%rdi
cmove  %rax,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xe8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
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 = [4 x i8] c"YES\00"
@.str.4 = [3 x i8] c"NO\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8
%5 = alloca [101 x i8]
%6 = alloca [101 x i8]
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 0, i32* %1
%12 = getelementptr inbounds [101 x i8], [101 x i8]* %5, i64 0, i64 0
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%16 = getelementptr inbounds [101 x i8], [101 x i8]* %6, i64 0, i64 0
%17 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %16)
%18 = getelementptr inbounds [101 x i8], [101 x i8]* %5, i64 0, i64 0
%19 = call i32 @length(i8* %18)
store i32 %19, i32* %7
%20 = getelementptr inbounds [101 x i8], [101 x i8]* %6, i64 0, i64 0
%21 = call i32 @length(i8* %20)
store i32 %21, i32* %8
store i32 0, i32* %9
%22 = getelementptr inbounds [101 x i8], [101 x i8]* %5, i64 0, i64 0
%23 = load i32, i32* %7
%24 = load i8, i8* %4
%25 = load i32, i32* %2
%26 = call i32 @check_char(i8* %22, i32 %23, i8 signext %24, i32 %25)
store i32 %26, i32* %10
store i32 0, i32* %3
br label %27
27: ; preds = %74, %0
%28 = load i32, i32* %3
%29 = load i32, i32* %7
%30 = load i32, i32* %8
%31 = sub nsw i32 %29, %30
%32 = icmp sle i32 %28, %31
br i1 %32, label %33, label %77
33: ; preds = %27
%34 = load i32, i32* %3
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [101 x i8], [101 x i8]* %5, i64 0, i64 %35
%37 = load i8, i8* %36
%38 = sext i8 %37 to i32
%39 = getelementptr inbounds [101 x i8], [101 x i8]* %6, i64 0, i64 0
%40 = load i8, i8* %39
%41 = sext i8 %40 to i32
%42 = icmp eq i32 %38, %41
br i1 %42, label %43, label %69
43: ; preds = %33
store i32 0, i32* %11
br label %44
44: ; preds = %65, %43
%45 = load i32, i32* %11
%46 = load i32, i32* %8
%47 = icmp slt i32 %45, %46
br i1 %47, label %48, label %68
48: ; preds = %44
%49 = load i32, i32* %3
%50 = load i32, i32* %11
%51 = add nsw i32 %49, %50
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds [101 x i8], [101 x i8]* %5, i64 0, i64 %52
%54 = load i8, i8* %53
%55 = sext i8 %54 to i32
%56 = load i32, i32* %11
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds [101 x i8], [101 x i8]* %6, i64 0, i64 %57
%59 = load i8, i8* %58
%60 = sext i8 %59 to i32
%61 = icmp eq i32 %55, %60
br i1 %61, label %62, label %63
62: ; preds = %48
store i32 1, i32* %9
br label %64
63: ; preds = %48
store i32 0, i32* %9
br label %64
64: ; preds = %63, %62
br label %65
65: ; preds = %64
%66 = load i32, i32* %11
%67 = add nsw i32 %66, 1
store i32 %67, i32* %11
br label %44
68: ; preds = %44
br label %69
69: ; preds = %68, %33
%70 = load i32, i32* %9
%71 = icmp eq i32 %70, 1
br i1 %71, label %72, label %73
72: ; preds = %69
br label %77
73: ; preds = %69
br label %74
74: ; preds = %73
%75 = load i32, i32* %3
%76 = add nsw i32 %75, 1
store i32 %76, i32* %3
br label %27
77: ; preds = %72, %27
%78 = load i32, i32* %10
%79 = load i32, i32* %9
%80 = add nsw i32 %78, %79
%81 = icmp eq i32 %80, 1
br i1 %81, label %82, label %84
82: ; preds = %77
%83 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
br label %86
84: ; preds = %77
%85 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
br label %86
86: ; preds = %84, %82
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 = [4 x i8] c"YES\00"
@.str.4 = [3 x i8] c"NO\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca [101 x i8]
%4 = alloca [101 x i8]
%5 = bitcast i32* %1 to i8*
%6 = getelementptr inbounds [101 x i8], [101 x i8]* %3, i64 0, i64 0
%7 = getelementptr inbounds [101 x i8], [101 x i8]* %4, i64 0, i64 0
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7)
%12 = call i32 @length(i8* %6)
%13 = call i32 @length(i8* %7)
%14 = load i8, i8* %2
%15 = load i32, i32* %1
%16 = call i32 @check_char(i8* %6, i32 %12, i8 signext %14, i32 %15)
%17 = icmp slt i32 %12, %13
br i1 %17, label %42, label %18
18: ; preds = %0
%19 = load i8, i8* %7
%20 = icmp slt i32 %13, 1
%21 = add i32 %13, -1
%22 = zext i32 %21 to i64
%23 = add i32 %12, 1
%24 = sub i32 %23, %13
%25 = zext i32 %24 to i64
%26 = getelementptr inbounds [101 x i8], [101 x i8]* %4, i64 0, i64 %22
br label %27
27: ; preds = %18, %39
%28 = phi i64 [ 0, %18 ], [ %40, %39 ]
%29 = getelementptr inbounds [101 x i8], [101 x i8]* %3, i64 0, i64 %28
%30 = load i8, i8* %29
%31 = icmp ne i8 %30, %19
%32 = select i1 %31, i1 true, i1 %20
br i1 %32, label %39, label %33
33: ; preds = %27
%34 = add nuw nsw i64 %28, %22
%35 = getelementptr inbounds [101 x i8], [101 x i8]* %3, i64 0, i64 %34
%36 = load i8, i8* %35
%37 = load i8, i8* %26
%38 = icmp eq i8 %36, %37
br i1 %38, label %42, label %39
39: ; preds = %27, %33
%40 = add nuw nsw i64 %28, 1
%41 = icmp eq i64 %40, %25
br i1 %41, label %42, label %27
42: ; preds = %39, %33, %0
%43 = phi i32 [ 0, %0 ], [ 1, %33 ], [ 0, %39 ]
%44 = add nsw i32 %43, %16
%45 = icmp eq i32 %44, 1
%46 = select i1 %45, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0)
%47 = call i32 @printf(i8* dereferenceable(1) %46)
ret i32 0
}