program main
implicit none
integer :: i, j, k, n, q
integer , allocatable :: a(:), b(:)

read(*,*) n, k, q
allocate( a(q), b(n) )
b = 0
do i = 1, q
   read(*,*) a(i) 
   b( a(i) ) = b( a(i) ) + 1
end do
do i = 1, n
   if( q - b(i) .ge. k ) then
      write(*,*) 'No'
   else
      write(*,*) 'Yes'
   end if
end do

end program main
; ModuleID = 'FIRModule'
source_filename = "FIRModule"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"

@_QFEa.0 = internal unnamed_addr global ptr null
@_QFEb.0 = internal unnamed_addr global ptr null
@_QFEb.7 = internal unnamed_addr global i64 1
@_QQcl.8a0fc07c17514dd3594be1e0031fc329 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_3251/source.f\00"
@_QQcl.16373402fa3425c6e46827601abb88fa = linkonce constant [76 x i8] c"array left hand side must be allocated when the right hand side is a scalar\00"
@_QQcl.4E6F = linkonce constant [2 x i8] c"No"
@_QQcl.596573 = linkonce constant [3 x i8] c"Yes"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #0

define void @_QQmain() local_unnamed_addr {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.8a0fc07c17514dd3594be1e0031fc329, i32 6)
  %5 = call i1 @_FortranAioInputInteger(ptr %4, ptr nonnull %2, i32 4)
  %6 = call i1 @_FortranAioInputInteger(ptr %4, ptr nonnull %1, i32 4)
  %7 = call i1 @_FortranAioInputInteger(ptr %4, ptr nonnull %3, i32 4)
  %8 = call i32 @_FortranAioEndIoStatement(ptr %4)
  %9 = load i32, ptr %3, align 4, !tbaa !3
  %10 = call i32 @llvm.smax.i32(i32 %9, i32 0)
  %11 = zext i32 %10 to i64
  %12 = shl nuw nsw i64 %11, 2
  %13 = call ptr @malloc(i64 %12)
  store ptr %13, ptr @_QFEa.0, align 8, !tbaa !7
  %14 = load i32, ptr %2, align 4, !tbaa !3
  %15 = call i32 @llvm.smax.i32(i32 %14, i32 0)
  %16 = zext i32 %15 to i64
  %17 = shl nuw nsw i64 %16, 2
  %18 = call ptr @malloc(i64 %17)
  store ptr %18, ptr @_QFEb.0, align 8, !tbaa !7
  store i64 1, ptr @_QFEb.7, align 8, !tbaa !7
  %.not = icmp eq ptr %18, null
  br i1 %.not, label %21, label %.preheader

.preheader:                                       ; preds = %0
  %.not305 = icmp slt i32 %14, 1
  br i1 %.not305, label %.loopexit, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.preheader
  %19 = call i64 @llvm.smax.i64(i64 %16, i64 1)
  %20 = shl nuw nsw i64 %19, 2
  call void @llvm.memset.p0.i64(ptr nonnull align 4 %18, i8 0, i64 %20, i1 false), !tbaa !3
  br label %.loopexit

21:                                               ; preds = %0
  %22 = call {} @_FortranAReportFatalUserError(ptr nonnull @_QQcl.16373402fa3425c6e46827601abb88fa, ptr nonnull @_QQcl.8a0fc07c17514dd3594be1e0031fc329, i32 8)
  %.unpack287.unpack.unpack = load i64, ptr @_QFEb.7, align 8, !tbaa !7
  %23 = icmp slt i32 %14, 1
  %24 = select i1 %23, i64 1, i64 %.unpack287.unpack.unpack
  store ptr null, ptr @_QFEb.0, align 8, !tbaa !7
  store i64 %24, ptr @_QFEb.7, align 8, !tbaa !7
  %.pre = load i32, ptr %3, align 4, !tbaa !3
  br label %.loopexit

.loopexit:                                        ; preds = %.lr.ph.preheader, %.preheader, %21
  %25 = phi i32 [ %9, %.lr.ph.preheader ], [ %9, %.preheader ], [ %.pre, %21 ]
  %26 = icmp sgt i32 %25, 0
  br i1 %26, label %.lr.ph301.preheader, label %._crit_edge

.lr.ph301.preheader:                              ; preds = %.loopexit
  %27 = zext i32 %25 to i64
  br label %.lr.ph301

.lr.ph301:                                        ; preds = %.lr.ph301.preheader, %.lr.ph301
  %indvars.iv = phi i64 [ 1, %.lr.ph301.preheader ], [ %indvars.iv.next, %.lr.ph301 ]
  %28 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.8a0fc07c17514dd3594be1e0031fc329, i32 10)
  %.unpack244 = load ptr, ptr @_QFEa.0, align 8, !tbaa !7
  %29 = add nsw i64 %indvars.iv, -1
  %30 = getelementptr i32, ptr %.unpack244, i64 %29
  %31 = call i1 @_FortranAioInputInteger(ptr %28, ptr %30, i32 4)
  %32 = call i32 @_FortranAioEndIoStatement(ptr %28)
  %.unpack256 = load ptr, ptr @_QFEb.0, align 8, !tbaa !7
  %.unpack263.unpack.unpack = load i64, ptr @_QFEb.7, align 8, !tbaa !7
  %.unpack268 = load ptr, ptr @_QFEa.0, align 8, !tbaa !7
  %33 = add nsw i64 %indvars.iv, -1
  %34 = getelementptr i32, ptr %.unpack268, i64 %33
  %35 = load i32, ptr %34, align 4, !tbaa !3
  %36 = sext i32 %35 to i64
  %37 = sub i64 %36, %.unpack263.unpack.unpack
  %38 = getelementptr i32, ptr %.unpack256, i64 %37
  %39 = load i32, ptr %38, align 4, !tbaa !3
  %40 = add i32 %39, 1
  store i32 %40, ptr %38, align 4, !tbaa !3
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv, %27
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph301

._crit_edge:                                      ; preds = %.lr.ph301, %.loopexit
  %41 = load i32, ptr %2, align 4, !tbaa !3
  %42 = icmp sgt i32 %41, 0
  br i1 %42, label %.lr.ph303.preheader, label %._crit_edge304

.lr.ph303.preheader:                              ; preds = %._crit_edge
  %43 = zext i32 %41 to i64
  br label %.lr.ph303

.lr.ph303:                                        ; preds = %.lr.ph303.preheader, %56
  %indvars.iv307 = phi i64 [ 1, %.lr.ph303.preheader ], [ %indvars.iv.next308, %56 ]
  %44 = load i32, ptr %3, align 4, !tbaa !3
  %.unpack = load ptr, ptr @_QFEb.0, align 8, !tbaa !7
  %.unpack238.unpack.unpack = load i64, ptr @_QFEb.7, align 8, !tbaa !7
  %45 = sub i64 %indvars.iv307, %.unpack238.unpack.unpack
  %46 = getelementptr i32, ptr %.unpack, i64 %45
  %47 = load i32, ptr %46, align 4, !tbaa !3
  %48 = sub i32 %44, %47
  %49 = load i32, ptr %1, align 4, !tbaa !3
  %.not243 = icmp slt i32 %48, %49
  br i1 %.not243, label %53, label %50

50:                                               ; preds = %.lr.ph303
  %51 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.8a0fc07c17514dd3594be1e0031fc329, i32 15)
  %52 = call i1 @_FortranAioOutputAscii(ptr %51, ptr nonnull @_QQcl.4E6F, i64 2)
  br label %56

53:                                               ; preds = %.lr.ph303
  %54 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.8a0fc07c17514dd3594be1e0031fc329, i32 17)
  %55 = call i1 @_FortranAioOutputAscii(ptr %54, ptr nonnull @_QQcl.596573, i64 3)
  br label %56

56:                                               ; preds = %50, %53
  %.sink = phi ptr [ %51, %50 ], [ %54, %53 ]
  %57 = call i32 @_FortranAioEndIoStatement(ptr %.sink)
  %indvars.iv.next308 = add nuw nsw i64 %indvars.iv307, 1
  %exitcond310.not = icmp eq i64 %indvars.iv307, %43
  br i1 %exitcond310.not, label %._crit_edge304, label %.lr.ph303

._crit_edge304:                                   ; preds = %56, %._crit_edge
  ret void
}

declare ptr @_FortranAioBeginExternalListInput(i32, ptr, i32) local_unnamed_addr

declare i1 @_FortranAioInputInteger(ptr, ptr, i32) local_unnamed_addr

declare i32 @_FortranAioEndIoStatement(ptr) local_unnamed_addr

declare {} @_FortranAReportFatalUserError(ptr, ptr, i32) local_unnamed_addr

declare ptr @_FortranAioBeginExternalListOutput(i32, ptr, i32) local_unnamed_addr

declare i1 @_FortranAioOutputAscii(ptr, ptr, i64) local_unnamed_addr

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #1

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

attributes #0 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: write) }

!llvm.module.flags = !{!0, !1, !2}

!0 = !{i32 2, !"Debug Info Version", i32 3}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{!4, !4, i64 0}
!4 = !{!"any data access", !5, i64 0}
!5 = !{!"any access", !6, i64 0}
!6 = !{!"Flang Type TBAA Root"}
!7 = !{!8, !8, i64 0}
!8 = !{!"descriptor member", !5, i64 0}
