#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
jge    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),%rbp
xor    %r15d,%r15d
lea    0x80(%rsp),%rbx
mov    %rbp,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0xe91(%rip),%rdi
lea    0xb(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0xe81(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0x10(%rsp),%r14
mov    %rbp,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    %rbx,%rdi
call   1030 <length@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1030 <length@plt>
mov    %eax,%r14d
movsbl 0xb(%rsp),%edx
mov    0xc(%rsp),%ecx
mov    %rbx,%rdi
mov    %ebp,%esi
call   1050 <check_char@plt>
sub    %r14d,%ebp
test   %ebp,%ebp
jle    1204 <main+0xc4>
mov    0x10(%rsp),%dil
lea    -0x1(%r14),%edx
mov    %ebp,%esi
jmp    11ea <main+0xaa>
add    $0x1,%rbx
add    $0xffffffffffffffff,%rsi
je     1204 <main+0xc4>
cmp    %dil,(%rbx)
jne    11e0 <main+0xa0>
test   %r14d,%r14d
jle    11e0 <main+0xa0>
movzbl (%rbx,%rdx,1),%ecx
cmp    0x10(%rsp,%rdx,1),%cl
jne    11e0 <main+0xa0>
mov    $0x1,%r15d
add    %eax,%r15d
cmp    $0x1,%r15d
lea    0xdf8(%rip),%rax
lea    0xdf5(%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 slt 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 = sub i32 %12, %13
%18 = icmp sgt i32 %17, 0
br i1 %18, label %19, label %41
19: ; preds = %0
%20 = load i8, i8* %7
%21 = icmp slt i32 %13, 1
%22 = add i32 %13, -1
%23 = zext i32 %22 to i64
%24 = zext i32 %17 to i64
%25 = getelementptr inbounds [101 x i8], [101 x i8]* %4, i64 0, i64 %23
br label %26
26: ; preds = %19, %38
%27 = phi i64 [ 0, %19 ], [ %39, %38 ]
%28 = getelementptr inbounds [101 x i8], [101 x i8]* %3, i64 0, i64 %27
%29 = load i8, i8* %28
%30 = icmp ne i8 %29, %20
%31 = select i1 %30, i1 true, i1 %21
br i1 %31, label %38, label %32
32: ; preds = %26
%33 = add nuw nsw i64 %27, %23
%34 = getelementptr inbounds [101 x i8], [101 x i8]* %3, i64 0, i64 %33
%35 = load i8, i8* %34
%36 = load i8, i8* %25
%37 = icmp eq i8 %35, %36
br i1 %37, label %41, label %38
38: ; preds = %26, %32
%39 = add nuw nsw i64 %27, 1
%40 = icmp eq i64 %39, %24
br i1 %40, label %41, label %26
41: ; preds = %38, %32, %0
%42 = phi i32 [ 0, %0 ], [ 1, %32 ], [ 0, %38 ]
%43 = add nsw i32 %42, %16
%44 = icmp eq i32 %43, 1
%45 = select i1 %44, 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)
%46 = call i32 @printf(i8* dereferenceable(1) %45)
ret i32 0
}