t=sorted(map(int,open(0).read().split()))
print(['YES','NO'][max([t.count(i)for i in range(1,5)])>2]) t=sorted(map(int,open(0).read().split())) t sorted(map(int,open(0).read().split())) sorted map(int,open(0).read().split()) map int open(0).read().split() (0).read().split (0).read() (0).read (0) open 0 read split t.count(i)for i in range(1,5) for i in range(1,5) i range(1,5) range 1 5 for i in range(1,5) t.count(i) t.count t count i print(['YES','NO'][max([t.count(i)for i in range(1,5)])>2]) print ['YES','NO'][max([t.count(i)for i in range(1,5)])>2] ['YES','NO'] 'YES' 'NO' max([t.count(i)for i in range(1,5)])>2 max([t.count(i)for i in range(1,5)]) max [t.count(i)for i in range(1,5)] 2 t=sorted(map(int,open(0).read().split())) sorted(map(int,open(0).read().split())) t
t=sorted(map(int,open(0).read().split()))
print(['YES','NO'][max([t.count(i)for i in range(1,5)])>2])