#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_substring(char *, char *);
int count_char(char *, char);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *, ...);
int main() {
  int n, count, check = 0;
  char c, s1[100], s2[100];
  scanf("%s\n", s1);
  scanf("%c %d\n", &c, &n);
  scanf("%s", s2);
  count = count_char(s1, c);
  if (count < n) {
    check++;
  }
  check = check + check_substring(s1, s2);
  if (check == 1) {
    printf("YES");
  } else {
    printf("NO");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
lea    -0x80(%rbp),%rsi
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1050 <scanf@plt>
lea    0xe92(%rip),%rdi
lea    -0x11(%rbp),%rsi
lea    -0x8(%rbp),%rdx
mov    $0x0,%al
call   1050 <scanf@plt>
lea    -0xf0(%rbp),%rsi
lea    0xe7c(%rip),%rdi
mov    $0x0,%al
call   1050 <scanf@plt>
lea    -0x80(%rbp),%rdi
movsbl -0x11(%rbp),%esi
call   1030 <count_char@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11bb <main+0x7b>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xf4(%rbp)
lea    -0x80(%rbp),%rdi
lea    -0xf0(%rbp),%rsi
call   1060 <check_substring@plt>
mov    %eax,%ecx
mov    -0xf4(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x1,-0x10(%rbp)
jne    11fc <main+0xbc>
lea    0xe1c(%rip),%rdi
call   1040 <printf@plt>
jmp    1208 <main+0xc8>
lea    0xe0f(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0xf0,%rsp
lea    0xeae(%rip),%rdi
lea    0x80(%rsp),%r14
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xe99(%rip),%rdi
lea    0xb(%rsp),%rsi
lea    0xc(%rsp),%rdx
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xe88(%rip),%rdi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
movsbl 0xb(%rsp),%esi
mov    %r14,%rdi
call   1030 <count_char@plt>
xor    %ebp,%ebp
cmp    0xc(%rsp),%eax
setl   %bpl
mov    %r14,%rdi
mov    %rbx,%rsi
call   1060 <check_substring@plt>
add    %ebp,%eax
cmp    $0x1,%eax
lea    0xe4e(%rip),%rax
lea    0xe4b(%rip),%rdi
cmove  %rax,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xf0,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [7 x i8] c"%c %d\0A\00"
@.str.2 = [3 x i8] c"%s\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 i32
%5 = alloca i8
%6 = alloca [100 x i8]
%7 = alloca [100 x i8]
store i32 0, i32* %1
store i32 0, i32* %4
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%9 = call i32 (i8*, i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = call i32 (i8*, i8*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %5, i32* %2)
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%12 = call i32 (i8*, i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %11)
%13 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%14 = load i8, i8* %5
%15 = call i32 @count_char(i8* %13, i8 signext %14)
store i32 %15, i32* %3
%16 = load i32, i32* %3
%17 = load i32, i32* %2
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %22
19: ; preds = %0
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 1
store i32 %21, i32* %4
br label %22
22: ; preds = %19, %0
%23 = load i32, i32* %4
%24 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%25 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%26 = call i32 @check_substring(i8* %24, i8* %25)
%27 = add nsw i32 %23, %26
store i32 %27, i32* %4
%28 = load i32, i32* %4
%29 = icmp eq i32 %28, 1
br i1 %29, label %30, label %32
30: ; preds = %22
%31 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
br label %34
32: ; preds = %22
%33 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
br label %34
34: ; preds = %32, %30
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [7 x i8] c"%c %d\0A\00"
@.str.2 = [3 x i8] c"%s\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 [100 x i8]
%4 = alloca [100 x i8]
%5 = bitcast i32* %1 to i8*
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%8 = call i32 (i8*, i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
%9 = call i32 (i8*, i8*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %2, i32* %1)
%10 = call i32 (i8*, i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %7)
%11 = load i8, i8* %2
%12 = call i32 @count_char(i8* %6, i8 signext %11)
%13 = load i32, i32* %1
%14 = icmp slt i32 %12, %13
%15 = zext i1 %14 to i32
%16 = call i32 @check_substring(i8* %6, i8* %7)
%17 = add nsw i32 %16, %15
%18 = icmp eq i32 %17, 1
%19 = select i1 %18, 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)
%20 = call i32 @printf(i8* dereferenceable(1) %19)
ret i32 0
}