      PROGRAM piyo
      IMPLICIT NONE
      integer :: n,i
      integer,allocatable :: d1(:),d2(:)
      character(3) :: ans = 'No '
      
      read*,n
      allocate( d1(n),d2(n) )
      do i = 1,n
        read*,d1(i),d2(i)
      end do
      
      
      do i = 2,n-1
        
        if( d1(i-1)/=d2(i-1) )cycle
        if( d1(i)/=d2(i) )cycle
        if( d1(i+1)/=d2(i+1) )cycle
        
        ans = 'Yes'
        
      end do
      
      
      print*,ans
      
      
      stop
      !debugg
      
      
      
      END PROGRAM
; 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"

@_QFEans = internal global [3 x i8] c"No "
@_QFEd1.0 = internal unnamed_addr global ptr null
@_QFEd2.0 = internal unnamed_addr global ptr null
@_QQcl.8e26952fccaf7f8ebef4fb3068773209 = linkonce constant [72 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_624/source.f\00"
@_QQcl.596573 = linkonce local_unnamed_addr 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

; Function Attrs: noreturn
define void @_QQmain() local_unnamed_addr #1 {
  %1 = alloca i32, align 4
  %2 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.8e26952fccaf7f8ebef4fb3068773209, i32 7)
  %3 = call i1 @_FortranAioInputInteger(ptr %2, ptr nonnull %1, i32 4)
  %4 = call i32 @_FortranAioEndIoStatement(ptr %2)
  %5 = load i32, ptr %1, align 4, !tbaa !3
  %6 = call i32 @llvm.smax.i32(i32 %5, i32 0)
  %7 = zext i32 %6 to i64
  %8 = shl nuw nsw i64 %7, 2
  %9 = call ptr @malloc(i64 %8)
  store ptr %9, ptr @_QFEd1.0, align 8, !tbaa !7
  %10 = call ptr @malloc(i64 %8)
  store ptr %10, ptr @_QFEd2.0, align 8, !tbaa !7
  %11 = icmp sgt i32 %5, 0
  br i1 %11, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %0
  %12 = zext i32 %5 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 ]
  %13 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.8e26952fccaf7f8ebef4fb3068773209, i32 10)
  %.unpack256 = load ptr, ptr @_QFEd1.0, align 8, !tbaa !7
  %14 = add nsw i64 %indvars.iv, -1
  %15 = getelementptr i32, ptr %.unpack256, i64 %14
  %16 = call i1 @_FortranAioInputInteger(ptr %13, ptr %15, i32 4)
  %.unpack268 = load ptr, ptr @_QFEd2.0, align 8, !tbaa !7
  %17 = add nsw i64 %indvars.iv, -1
  %18 = getelementptr i32, ptr %.unpack268, i64 %17
  %19 = call i1 @_FortranAioInputInteger(ptr %13, ptr %18, i32 4)
  %20 = call i32 @_FortranAioEndIoStatement(ptr %13)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv, %12
  br i1 %exitcond.not, label %._crit_edge.loopexit, label %.lr.ph

._crit_edge.loopexit:                             ; preds = %.lr.ph
  %.pre = load i32, ptr %1, align 4, !tbaa !3
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %0
  %21 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %5, %0 ]
  %22 = add i32 %21, -1
  %23 = icmp sgt i32 %22, 1
  br i1 %23, label %.lr.ph281, label %._crit_edge282

.lr.ph281:                                        ; preds = %._crit_edge
  %24 = zext i32 %22 to i64
  %.unpack = load ptr, ptr @_QFEd1.0, align 8, !tbaa !7
  %.unpack244 = load ptr, ptr @_QFEd2.0, align 8, !tbaa !7
  br label %25

25:                                               ; preds = %.lr.ph281, %52
  %indvars.iv284 = phi i64 [ 2, %.lr.ph281 ], [ %indvars.iv.next285, %52 ]
  %26 = add nsw i64 %indvars.iv284, -2
  %27 = getelementptr i32, ptr %.unpack, i64 %26
  %28 = load i32, ptr %27, align 4, !tbaa !3
  %29 = add nsw i64 %indvars.iv284, -2
  %30 = getelementptr i32, ptr %.unpack244, i64 %29
  %31 = load i32, ptr %30, align 4, !tbaa !3
  %32 = icmp eq i32 %28, %31
  br i1 %32, label %33, label %52

33:                                               ; preds = %25
  %34 = add nsw i64 %indvars.iv284, -1
  %35 = getelementptr i32, ptr %.unpack, i64 %34
  %36 = load i32, ptr %35, align 4, !tbaa !3
  %37 = add nsw i64 %indvars.iv284, -1
  %38 = getelementptr i32, ptr %.unpack244, i64 %37
  %39 = load i32, ptr %38, align 4, !tbaa !3
  %40 = icmp eq i32 %36, %39
  br i1 %40, label %41, label %52

41:                                               ; preds = %33
  %42 = shl i64 %indvars.iv284, 32
  %sext = add i64 %42, 4294967296
  %43 = ashr exact i64 %sext, 32
  %44 = add nsw i64 %43, -1
  %45 = getelementptr i32, ptr %.unpack, i64 %44
  %46 = load i32, ptr %45, align 4, !tbaa !3
  %47 = add nsw i64 %43, -1
  %48 = getelementptr i32, ptr %.unpack244, i64 %47
  %49 = load i32, ptr %48, align 4, !tbaa !3
  %50 = icmp eq i32 %46, %49
  br i1 %50, label %51, label %52

51:                                               ; preds = %41
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) @_QFEans, ptr noundef nonnull align 1 dereferenceable(3) @_QQcl.596573, i64 3, i1 false)
  br label %52

52:                                               ; preds = %51, %41, %33, %25
  %indvars.iv.next285 = add nuw nsw i64 %indvars.iv284, 1
  %exitcond287.not = icmp eq i64 %indvars.iv284, %24
  br i1 %exitcond287.not, label %._crit_edge282, label %25

._crit_edge282:                                   ; preds = %52, %._crit_edge
  %53 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.8e26952fccaf7f8ebef4fb3068773209, i32 25)
  %54 = call i1 @_FortranAioOutputAscii(ptr %53, ptr nonnull @_QFEans, i64 3)
  %55 = call i32 @_FortranAioEndIoStatement(ptr %53)
  %56 = call {} @_FortranAStopStatement(i32 0, i1 false, i1 false)
  unreachable
}

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

declare {} @_FortranAStopStatement(i32, i1, i1) local_unnamed_addr

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

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

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