from collections import defaultdict
cnt = defaultdict(int)
for i in range(3):
    a, b = map(int, input().split())
    cnt[a] += 1
    cnt[b] += 1

print("YES" if max(cnt.values()) == 2 and min(cnt.values()) == 1 else "NO") from collections import defaultdict cnt = defaultdict(int) cnt defaultdict(int) defaultdict int for i in range(3):
    a, b = map(int, input().split())
    cnt[a] += 1
    cnt[b] += 1 i 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 cnt[a] cnt a 1 cnt[b] += 1 cnt[b] cnt b 1 print("YES" if max(cnt.values()) == 2 and min(cnt.values()) == 1 else "NO") print "YES" if max(cnt.values()) == 2 and min(cnt.values()) == 1 else "NO" max(cnt.values()) == 2 and min(cnt.values()) == 1 max(cnt.values()) == 2 max(cnt.values()) max cnt.values() cnt.values cnt values 2 min(cnt.values()) == 1 min(cnt.values()) min cnt.values() cnt.values cnt values 1 "YES" "NO" cnt = defaultdict(int) defaultdict(int) cnt b = map(int, input().split()) map(int, input().split()) b a, b = map(int, input().split()) map(int, input().split()) a
from collections import defaultdict
cnt = defaultdict(int)
for i in range(3):
    a, b = map(int, input().split())
    cnt[a] += 1
    cnt[b] += 1

print("YES" if max(cnt.values()) == 2 and min(cnt.values()) == 1 else "NO")