cnt = [0 for _ in range(4)]
for _ in range(3):
  a,b = map(int,input().split())
  cnt[a-1] += 1
  cnt[b-1] += 1

print('YES' if 1<=min(cnt) and max(cnt)<=2 else 'NO') 0 for _ in range(4) for _ in range(4) _ range(4) range 4 for _ in range(4) 0 cnt = [0 for _ in range(4)] cnt [0 for _ in range(4)] for _ in range(3):
  a,b = map(int,input().split())
  cnt[a-1] += 1
  cnt[b-1] += 1 _ range(3) range 3 a,b = map(int,input().split()) a map(int,input().split()) map int input().split() ().split () input split b cnt[a-1] += 1 cnt[a-1] cnt a-1 a 1 1 cnt[b-1] += 1 cnt[b-1] cnt b-1 b 1 1 print('YES' if 1<=min(cnt) and max(cnt)<=2 else 'NO') print 'YES' if 1<=min(cnt) and max(cnt)<=2 else 'NO' 1<=min(cnt) and max(cnt)<=2 1<=min(cnt) 1 min(cnt) min cnt max(cnt)<=2 max(cnt) max cnt 2 'YES' 'NO' b = map(int,input().split()) map(int,input().split()) b cnt = [0 for _ in range(4)] [0 for _ in range(4)] cnt a,b = map(int,input().split()) map(int,input().split()) a
cnt = [0 for _ in range(4)]
for _ in range(3):
  a,b = map(int,input().split())
  cnt[a-1] += 1
  cnt[b-1] += 1

print('YES' if 1<=min(cnt) and max(cnt)<=2 else 'NO')