import collections
a=collections.Counter(open(0).read().split())
v,c=zip(*a.most_common())
print("YES" if c[0]==c[1]==2 and c[2]==c[3]==1 else "NO") import collections collections a=collections.Counter(open(0).read().split()) a collections.Counter(open(0).read().split()) collections.Counter collections Counter open(0).read().split() (0).read().split (0).read() (0).read (0) open 0 read split v,c=zip(*a.most_common()) v zip(*a.most_common()) zip *a.most_common() a.most_common() a.most_common a most_common c print("YES" if c[0]==c[1]==2 and c[2]==c[3]==1 else "NO") print "YES" if c[0]==c[1]==2 and c[2]==c[3]==1 else "NO" c[0]==c[1]==2 and c[2]==c[3]==1 c[0]==c[1]==2 c[0]==c[1] c[0] c 0 c[1] c 1 2 c[2]==c[3]==1 c[2]==c[3] c[2] c 2 c[3] c 3 1 "YES" "NO" a=collections.Counter(open(0).read().split()) collections.Counter(open(0).read().split()) a v,c=zip(*a.most_common()) zip(*a.most_common()) v c=zip(*a.most_common()) zip(*a.most_common()) c
import collections
a=collections.Counter(open(0).read().split())
v,c=zip(*a.most_common())
print("YES" if c[0]==c[1]==2 and c[2]==c[3]==1 else "NO")