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

  read(*,*) n,k,q

  allocate( a(q) )
  allocate( na(n) )

  do i = 1, q
    read(*,*) a(i)
  end do

  na = - q + k

  do i = 1, q
    na(a(i)) = na(a(i)) + 1
  end do
  
  j = 0
  do i = 1, n
    if ( na(i) <= 0 ) then
      print*,"No"
    else
      print*,"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
@_QFEna.0 = internal unnamed_addr global ptr null
@_QFEna.7 = internal unnamed_addr global i64 1
@_QFEna.8 = internal unnamed_addr global i64 0
@_QQcl.8b3205b7c13e1e184546e285e5fdfa69 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_3254/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.8b3205b7c13e1e184546e285e5fdfa69, i32 8)
  %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 @_QFEna.0, align 8, !tbaa !7
  store i64 1, ptr @_QFEna.7, align 8, !tbaa !7
  store i64 %16, ptr @_QFEna.8, align 8, !tbaa !7
  %19 = icmp sgt i32 %9, 0
  br i1 %19, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %0
  %20 = zext i32 %9 to i64
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ 1, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %21 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.8b3205b7c13e1e184546e285e5fdfa69, i32 14)
  %.unpack302 = load ptr, ptr @_QFEa.0, align 8, !tbaa !7
  %22 = add nsw i64 %indvars.iv, -1
  %23 = getelementptr i32, ptr %.unpack302, i64 %22
  %24 = call i1 @_FortranAioInputInteger(ptr %21, ptr %23, i32 4)
  %25 = call i32 @_FortranAioEndIoStatement(ptr %21)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv, %20
  br i1 %exitcond.not, label %._crit_edge.loopexit, label %.lr.ph

._crit_edge.loopexit:                             ; preds = %.lr.ph
  %.pre = load i32, ptr %3, align 4, !tbaa !3
  %.unpack.pre = load ptr, ptr @_QFEna.0, align 8, !tbaa !7
  %.unpack240.unpack.unpack242.pre = load i64, ptr @_QFEna.8, align 8, !tbaa !7
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %0
  %.unpack240.unpack.unpack242 = phi i64 [ %.unpack240.unpack.unpack242.pre, %._crit_edge.loopexit ], [ %16, %0 ]
  %.unpack = phi ptr [ %.unpack.pre, %._crit_edge.loopexit ], [ %18, %0 ]
  %26 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %9, %0 ]
  %27 = load i32, ptr %1, align 4, !tbaa !3
  %28 = sub i32 %27, %26
  %.not = icmp eq ptr %.unpack, null
  br i1 %.not, label %36, label %.preheader

.preheader:                                       ; preds = %._crit_edge
  %29 = icmp sgt i64 %.unpack240.unpack.unpack242, 0
  br i1 %29, label %.lr.ph314.preheader, label %.loopexit

.lr.ph314.preheader:                              ; preds = %.preheader
  %min.iters.check = icmp ult i64 %.unpack240.unpack.unpack242, 8
  br i1 %min.iters.check, label %.lr.ph314.preheader336, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph314.preheader
  %n.vec = and i64 %.unpack240.unpack.unpack242, -8
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %28, i64 0
  %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  %broadcast.splatinsert334 = insertelement <4 x i32> poison, i32 %28, i64 0
  %broadcast.splat335 = shufflevector <4 x i32> %broadcast.splatinsert334, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %30 = getelementptr i32, ptr %.unpack, i64 %index
  store <4 x i32> %broadcast.splat, ptr %30, align 4, !tbaa !3
  %31 = getelementptr i32, ptr %30, i64 4
  store <4 x i32> %broadcast.splat335, ptr %31, align 4, !tbaa !3
  %index.next = add nuw i64 %index, 8
  %32 = icmp eq i64 %index.next, %n.vec
  br i1 %32, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %.unpack240.unpack.unpack242, %n.vec
  br i1 %cmp.n, label %.loopexit, label %.lr.ph314.preheader336

.lr.ph314.preheader336:                           ; preds = %.lr.ph314.preheader, %middle.block
  %.ph = phi i64 [ 0, %.lr.ph314.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph314

.lr.ph314:                                        ; preds = %.lr.ph314.preheader336, %.lr.ph314
  %33 = phi i64 [ %34, %.lr.ph314 ], [ %.ph, %.lr.ph314.preheader336 ]
  %34 = add nuw nsw i64 %33, 1
  %35 = getelementptr i32, ptr %.unpack, i64 %33
  store i32 %28, ptr %35, align 4, !tbaa !3
  %exitcond322.not = icmp eq i64 %34, %.unpack240.unpack.unpack242
  br i1 %exitcond322.not, label %.loopexit, label %.lr.ph314, !llvm.loop !12

36:                                               ; preds = %._crit_edge
  %37 = call {} @_FortranAReportFatalUserError(ptr nonnull @_QQcl.16373402fa3425c6e46827601abb88fa, ptr nonnull @_QQcl.8b3205b7c13e1e184546e285e5fdfa69, i32 17)
  %.unpack288.unpack.unpack = load i64, ptr @_QFEna.7, align 8, !tbaa !7
  %38 = icmp eq i64 %.unpack240.unpack.unpack242, 0
  %39 = select i1 %38, i64 1, i64 %.unpack288.unpack.unpack
  store ptr null, ptr @_QFEna.0, align 8, !tbaa !7
  store i64 %39, ptr @_QFEna.7, align 8, !tbaa !7
  store i64 %.unpack240.unpack.unpack242, ptr @_QFEna.8, align 8, !tbaa !7
  br label %.loopexit

.loopexit:                                        ; preds = %.lr.ph314, %middle.block, %.preheader, %36
  %40 = load i32, ptr %3, align 4, !tbaa !3
  %41 = icmp sgt i32 %40, 0
  br i1 %41, label %.lr.ph316, label %._crit_edge317

.lr.ph316:                                        ; preds = %.loopexit
  %42 = zext i32 %40 to i64
  %.unpack264.unpack.unpack = load i64, ptr @_QFEna.7, align 8, !tbaa !7
  %.unpack269 = load ptr, ptr @_QFEa.0, align 8, !tbaa !7
  %xtraiter = and i64 %42, 1
  %43 = icmp eq i32 %40, 1
  br i1 %43, label %._crit_edge317.loopexit.unr-lcssa, label %.lr.ph316.new

.lr.ph316.new:                                    ; preds = %.lr.ph316
  %unroll_iter = and i64 %42, 4294967294
  br label %44

44:                                               ; preds = %44, %.lr.ph316.new
  %indvars.iv323 = phi i64 [ 1, %.lr.ph316.new ], [ %indvars.iv.next324.1, %44 ]
  %niter = phi i64 [ 0, %.lr.ph316.new ], [ %niter.next.1, %44 ]
  %45 = add nsw i64 %indvars.iv323, -1
  %46 = getelementptr i32, ptr %.unpack269, i64 %45
  %47 = load i32, ptr %46, align 4, !tbaa !3
  %48 = sext i32 %47 to i64
  %49 = sub i64 %48, %.unpack264.unpack.unpack
  %50 = getelementptr i32, ptr %.unpack, i64 %49
  %51 = load i32, ptr %50, align 4, !tbaa !3
  %52 = add i32 %51, 1
  store i32 %52, ptr %50, align 4, !tbaa !3
  %53 = getelementptr i32, ptr %.unpack269, i64 %indvars.iv323
  %54 = load i32, ptr %53, align 4, !tbaa !3
  %55 = sext i32 %54 to i64
  %56 = sub i64 %55, %.unpack264.unpack.unpack
  %57 = getelementptr i32, ptr %.unpack, i64 %56
  %58 = load i32, ptr %57, align 4, !tbaa !3
  %59 = add i32 %58, 1
  store i32 %59, ptr %57, align 4, !tbaa !3
  %indvars.iv.next324.1 = add nuw nsw i64 %indvars.iv323, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge317.loopexit.unr-lcssa.loopexit, label %44

._crit_edge317.loopexit.unr-lcssa.loopexit:       ; preds = %44
  %60 = add nuw nsw i64 %indvars.iv323, 1
  br label %._crit_edge317.loopexit.unr-lcssa

._crit_edge317.loopexit.unr-lcssa:                ; preds = %._crit_edge317.loopexit.unr-lcssa.loopexit, %.lr.ph316
  %indvars.iv323.unr = phi i64 [ 0, %.lr.ph316 ], [ %60, %._crit_edge317.loopexit.unr-lcssa.loopexit ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge317, label %._crit_edge317.loopexit.epilog-lcssa

._crit_edge317.loopexit.epilog-lcssa:             ; preds = %._crit_edge317.loopexit.unr-lcssa
  %61 = getelementptr i32, ptr %.unpack269, i64 %indvars.iv323.unr
  %62 = load i32, ptr %61, align 4, !tbaa !3
  %63 = sext i32 %62 to i64
  %64 = sub i64 %63, %.unpack264.unpack.unpack
  %65 = getelementptr i32, ptr %.unpack, i64 %64
  %66 = load i32, ptr %65, align 4, !tbaa !3
  %67 = add i32 %66, 1
  store i32 %67, ptr %65, align 4, !tbaa !3
  br label %._crit_edge317

._crit_edge317:                                   ; preds = %._crit_edge317.loopexit.epilog-lcssa, %._crit_edge317.loopexit.unr-lcssa, %.loopexit
  %68 = load i32, ptr %2, align 4, !tbaa !3
  %69 = icmp sgt i32 %68, 0
  br i1 %69, label %.lr.ph319.preheader, label %._crit_edge320

.lr.ph319.preheader:                              ; preds = %._crit_edge317
  %70 = zext i32 %68 to i64
  br label %.lr.ph319

.lr.ph319:                                        ; preds = %.lr.ph319.preheader, %81
  %indvars.iv327 = phi i64 [ 1, %.lr.ph319.preheader ], [ %indvars.iv.next328, %81 ]
  %.unpack245 = load ptr, ptr @_QFEna.0, align 8, !tbaa !7
  %.unpack252.unpack.unpack = load i64, ptr @_QFEna.7, align 8, !tbaa !7
  %71 = sub i64 %indvars.iv327, %.unpack252.unpack.unpack
  %72 = getelementptr i32, ptr %.unpack245, i64 %71
  %73 = load i32, ptr %72, align 4, !tbaa !3
  %74 = icmp slt i32 %73, 1
  br i1 %74, label %75, label %78

75:                                               ; preds = %.lr.ph319
  %76 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.8b3205b7c13e1e184546e285e5fdfa69, i32 26)
  %77 = call i1 @_FortranAioOutputAscii(ptr %76, ptr nonnull @_QQcl.4E6F, i64 2)
  br label %81

78:                                               ; preds = %.lr.ph319
  %79 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.8b3205b7c13e1e184546e285e5fdfa69, i32 28)
  %80 = call i1 @_FortranAioOutputAscii(ptr %79, ptr nonnull @_QQcl.596573, i64 3)
  br label %81

81:                                               ; preds = %75, %78
  %.sink = phi ptr [ %76, %75 ], [ %79, %78 ]
  %82 = call i32 @_FortranAioEndIoStatement(ptr %.sink)
  %indvars.iv.next328 = add nuw nsw i64 %indvars.iv327, 1
  %exitcond330.not = icmp eq i64 %indvars.iv327, %70
  br i1 %exitcond330.not, label %._crit_edge320, label %.lr.ph319

._crit_edge320:                                   ; preds = %81, %._crit_edge317
  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 i32 @llvm.smax.i32(i32, i32) #1

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) }

!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}
!9 = distinct !{!9, !10, !11}
!10 = !{!"llvm.loop.isvectorized", i32 1}
!11 = !{!"llvm.loop.unroll.runtime.disable"}
!12 = distinct !{!12, !11, !10}
