program abc
	implicit none
	integer :: i,j,n,m,y
	integer :: aij(3,3)=0,xij(3,3)=0
	integer :: bn(10)=0
    
	do i = 1, 3
		read(*,*) (aij(i,j),j=1,3)
	enddo 
	read(*,*) n
	do m = 1, n
		read(*,*) bn(m)
		do i = 1, 3
		do j = 1, 3
			if(bn(m) == aij(i,j)) then
				xij(i,j) = 1
			endif
		enddo
		enddo
	enddo

	y = 0

	if(xij(1,1) + xij(1,2) + xij(1,3) == 3) y = 1
	if(xij(2,1) + xij(2,2) + xij(2,3) == 3) y = 1
	if(xij(3,1) + xij(3,2) + xij(3,3) == 3) y = 1 

	if(xij(1,1) + xij(2,1) + xij(3,1) == 3) y = 1
	if(xij(1,2) + xij(2,2) + xij(3,2) == 3) y = 1
	if(xij(1,3) + xij(2,3) + xij(3,3) == 3) y = 1

	if(xij(1,1) + xij(2,2) + xij(3,3) == 3) y = 1
	if(xij(3,1) + xij(2,2) + xij(1,3) == 3) y = 1

	if(y == 1) then
    		write(*,*) 'Yes'
	else
    		write(*,*) 'No'
	endif

end program abc
; 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"

@_QFEaij = internal global [3 x [3 x i32]] zeroinitializer
@_QFEbn = internal global [10 x i32] zeroinitializer
@_QFExij.0 = internal unnamed_addr global i1 false
@_QFExij.1 = internal unnamed_addr global i1 false
@_QFExij.2 = internal unnamed_addr global i1 false
@_QFExij.3 = internal unnamed_addr global i1 false
@_QFExij.4 = internal unnamed_addr global i1 false
@_QFExij.5 = internal unnamed_addr global i1 false
@_QFExij.6 = internal unnamed_addr global i1 false
@_QFExij.7 = internal unnamed_addr global i1 false
@_QFExij.8 = internal unnamed_addr global i1 false
@_QQcl.f723034fd34d2d045f503f0cff1b4a83 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_2260/source.f\00"
@_QQcl.596573 = linkonce constant [3 x i8] c"Yes"
@_QQcl.4E6F = linkonce constant [2 x i8] c"No"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

define void @_QQmain() local_unnamed_addr {
  %1 = alloca i32, align 4
  %2 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.f723034fd34d2d045f503f0cff1b4a83, i32 8)
  %3 = tail call i1 @_FortranAioInputInteger(ptr %2, ptr nonnull @_QFEaij, i32 4)
  %4 = tail call i1 @_FortranAioInputInteger(ptr %2, ptr nonnull getelementptr inbounds ([3 x [3 x i32]], ptr @_QFEaij, i64 0, i64 1, i64 0), i32 4)
  %5 = tail call i1 @_FortranAioInputInteger(ptr %2, ptr nonnull getelementptr inbounds ([3 x [3 x i32]], ptr @_QFEaij, i64 0, i64 2, i64 0), i32 4)
  %6 = tail call i32 @_FortranAioEndIoStatement(ptr %2)
  %7 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.f723034fd34d2d045f503f0cff1b4a83, i32 8)
  %8 = tail call i1 @_FortranAioInputInteger(ptr %7, ptr nonnull getelementptr inbounds ([3 x [3 x i32]], ptr @_QFEaij, i64 0, i64 0, i64 1), i32 4)
  %9 = tail call i1 @_FortranAioInputInteger(ptr %7, ptr nonnull getelementptr inbounds ([3 x [3 x i32]], ptr @_QFEaij, i64 0, i64 1, i64 1), i32 4)
  %10 = tail call i1 @_FortranAioInputInteger(ptr %7, ptr nonnull getelementptr inbounds ([3 x [3 x i32]], ptr @_QFEaij, i64 0, i64 2, i64 1), i32 4)
  %11 = tail call i32 @_FortranAioEndIoStatement(ptr %7)
  %12 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.f723034fd34d2d045f503f0cff1b4a83, i32 8)
  %13 = tail call i1 @_FortranAioInputInteger(ptr %12, ptr nonnull getelementptr inbounds ([3 x [3 x i32]], ptr @_QFEaij, i64 0, i64 0, i64 2), i32 4)
  %14 = tail call i1 @_FortranAioInputInteger(ptr %12, ptr nonnull getelementptr inbounds ([3 x [3 x i32]], ptr @_QFEaij, i64 0, i64 1, i64 2), i32 4)
  %15 = tail call i1 @_FortranAioInputInteger(ptr %12, ptr nonnull getelementptr inbounds ([3 x [3 x i32]], ptr @_QFEaij, i64 0, i64 2, i64 2), i32 4)
  %16 = tail call i32 @_FortranAioEndIoStatement(ptr %12)
  %17 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.f723034fd34d2d045f503f0cff1b4a83, i32 10)
  %18 = call i1 @_FortranAioInputInteger(ptr %17, ptr nonnull %1, i32 4)
  %19 = call i32 @_FortranAioEndIoStatement(ptr %17)
  %20 = load i32, ptr %1, align 4, !tbaa !3
  %21 = icmp sgt i32 %20, 0
  br i1 %21, label %.lr.ph.preheader, label %._crit_edge

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

.lr.ph:                                           ; preds = %.lr.ph.preheader, %62
  %indvars.iv = phi i64 [ 1, %.lr.ph.preheader ], [ %indvars.iv.next, %62 ]
  %23 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.f723034fd34d2d045f503f0cff1b4a83, i32 12)
  %24 = add nsw i64 %indvars.iv, -1
  %25 = getelementptr [10 x i32], ptr @_QFEbn, i64 0, i64 %24
  %26 = call i1 @_FortranAioInputInteger(ptr %23, ptr %25, i32 4)
  %27 = call i32 @_FortranAioEndIoStatement(ptr %23)
  %28 = load i32, ptr %25, align 4, !tbaa !3
  %29 = load i32, ptr @_QFEaij, align 16, !tbaa !3
  %30 = icmp eq i32 %28, %29
  br i1 %30, label %31, label %32

31:                                               ; preds = %.lr.ph
  store i1 true, ptr @_QFExij.0, align 1
  br label %32

32:                                               ; preds = %31, %.lr.ph
  %33 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @_QFEaij, i64 0, i64 1, i64 0), align 4, !tbaa !3
  %34 = icmp eq i32 %28, %33
  br i1 %34, label %35, label %36

35:                                               ; preds = %32
  store i1 true, ptr @_QFExij.3, align 1
  br label %36

36:                                               ; preds = %35, %32
  %37 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @_QFEaij, i64 0, i64 2, i64 0), align 8, !tbaa !3
  %38 = icmp eq i32 %28, %37
  br i1 %38, label %39, label %.preheader.1

39:                                               ; preds = %36
  store i1 true, ptr @_QFExij.6, align 1
  br label %.preheader.1

.preheader.1:                                     ; preds = %39, %36
  %40 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @_QFEaij, i64 0, i64 0, i64 1), align 4, !tbaa !3
  %41 = icmp eq i32 %28, %40
  br i1 %41, label %42, label %43

42:                                               ; preds = %.preheader.1
  store i1 true, ptr @_QFExij.1, align 1
  br label %43

43:                                               ; preds = %42, %.preheader.1
  %44 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @_QFEaij, i64 0, i64 1, i64 1), align 16, !tbaa !3
  %45 = icmp eq i32 %28, %44
  br i1 %45, label %46, label %47

46:                                               ; preds = %43
  store i1 true, ptr @_QFExij.4, align 1
  br label %47

47:                                               ; preds = %46, %43
  %48 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @_QFEaij, i64 0, i64 2, i64 1), align 4, !tbaa !3
  %49 = icmp eq i32 %28, %48
  br i1 %49, label %50, label %.preheader.2

50:                                               ; preds = %47
  store i1 true, ptr @_QFExij.7, align 1
  br label %.preheader.2

.preheader.2:                                     ; preds = %50, %47
  %51 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @_QFEaij, i64 0, i64 0, i64 2), align 8, !tbaa !3
  %52 = icmp eq i32 %28, %51
  br i1 %52, label %53, label %54

53:                                               ; preds = %.preheader.2
  store i1 true, ptr @_QFExij.2, align 1
  br label %54

54:                                               ; preds = %53, %.preheader.2
  %55 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @_QFEaij, i64 0, i64 1, i64 2), align 4, !tbaa !3
  %56 = icmp eq i32 %28, %55
  br i1 %56, label %57, label %58

57:                                               ; preds = %54
  store i1 true, ptr @_QFExij.5, align 1
  br label %58

58:                                               ; preds = %57, %54
  %59 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @_QFEaij, i64 0, i64 2, i64 2), align 16, !tbaa !3
  %60 = icmp eq i32 %28, %59
  br i1 %60, label %61, label %62

61:                                               ; preds = %58
  store i1 true, ptr @_QFExij.8, align 1
  br label %62

62:                                               ; preds = %61, %58
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv, %22
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %62, %0
  %.b = load i1, ptr @_QFExij.0, align 1
  %63 = zext i1 %.b to i32
  %.b33 = load i1, ptr @_QFExij.3, align 1
  %64 = zext i1 %.b33 to i32
  %65 = add nuw nsw i32 %64, %63
  %.b36 = load i1, ptr @_QFExij.6, align 1
  %66 = zext i1 %.b36 to i32
  %67 = add nuw nsw i32 %65, %66
  %68 = icmp eq i32 %67, 3
  %.b31 = load i1, ptr @_QFExij.1, align 1
  %69 = zext i1 %.b31 to i32
  %.b34 = load i1, ptr @_QFExij.4, align 1
  %70 = zext i1 %.b34 to i32
  %71 = add nuw nsw i32 %70, %69
  %.b37 = load i1, ptr @_QFExij.7, align 1
  %72 = zext i1 %.b37 to i32
  %73 = add nuw nsw i32 %71, %72
  %74 = icmp eq i32 %73, 3
  %.b32 = load i1, ptr @_QFExij.2, align 1
  %75 = zext i1 %.b32 to i32
  %.b35 = load i1, ptr @_QFExij.5, align 1
  %76 = zext i1 %.b35 to i32
  %77 = add nuw nsw i32 %76, %75
  %.b38 = load i1, ptr @_QFExij.8, align 1
  %78 = zext i1 %.b38 to i32
  %79 = add nuw nsw i32 %77, %78
  %80 = icmp eq i32 %79, 3
  %81 = add nuw nsw i32 %69, %63
  %82 = add nuw nsw i32 %81, %75
  %83 = icmp eq i32 %82, 3
  %84 = add nuw nsw i32 %70, %64
  %85 = add nuw nsw i32 %84, %76
  %86 = icmp eq i32 %85, 3
  %87 = add nuw nsw i32 %72, %66
  %88 = add nuw nsw i32 %87, %78
  %89 = icmp eq i32 %88, 3
  %90 = add nuw nsw i32 %70, %63
  %91 = add nuw nsw i32 %90, %78
  %92 = icmp eq i32 %91, 3
  %93 = add nuw nsw i32 %70, %66
  %94 = add nuw nsw i32 %93, %75
  %95 = icmp eq i32 %94, 3
  %96 = select i1 %95, i1 true, i1 %92
  %97 = select i1 %96, i1 true, i1 %89
  %98 = select i1 %97, i1 true, i1 %86
  %99 = select i1 %98, i1 true, i1 %83
  %100 = select i1 %99, i1 true, i1 %80
  %101 = select i1 %100, i1 true, i1 %74
  %narrow = select i1 %101, i1 true, i1 %68
  br i1 %narrow, label %102, label %105

102:                                              ; preds = %._crit_edge
  %103 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.f723034fd34d2d045f503f0cff1b4a83, i32 36)
  %104 = call i1 @_FortranAioOutputAscii(ptr %103, ptr nonnull @_QQcl.596573, i64 3)
  br label %108

105:                                              ; preds = %._crit_edge
  %106 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.f723034fd34d2d045f503f0cff1b4a83, i32 38)
  %107 = call i1 @_FortranAioOutputAscii(ptr %106, ptr nonnull @_QQcl.4E6F, i64 2)
  br label %108

108:                                              ; preds = %102, %105
  %.sink = phi ptr [ %103, %102 ], [ %106, %105 ]
  %109 = call i32 @_FortranAioEndIoStatement(ptr %.sink)
  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 ptr @_FortranAioBeginExternalListOutput(i32, ptr, i32) local_unnamed_addr

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

!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"}
