town=[0 for _ in range(4)]
for i in range(3):
    a,b=map(int,input().split())
    town[a-1]+=1
    town[b-1]+=1
if town.count(1)==2 and town.count(2)==2:
    print('YES')
else:
    print('NO') 0 for _ in range(4) for _ in range(4) _ range(4) range 4 for _ in range(4) 0 town=[0 for _ in range(4)] town [0 for _ in range(4)] for i in range(3):
    a,b=map(int,input().split())
    town[a-1]+=1
    town[b-1]+=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 town[a-1]+=1 town[a-1] town a-1 a 1 1 town[b-1]+=1 town[b-1] town b-1 b 1 1 if town.count(1)==2 and town.count(2)==2:
    print('YES')
else:
    print('NO') town.count(1)==2 and town.count(2)==2 town.count(1)==2 town.count(1) town.count town count 1 2 town.count(2)==2 town.count(2) town.count town count 2 2 print('YES') print 'YES' print('NO') print 'NO' a,b=map(int,input().split()) map(int,input().split()) a town=[0 for _ in range(4)] [0 for _ in range(4)] town b=map(int,input().split()) map(int,input().split()) b
town=[0 for _ in range(4)]
for i in range(3):
    a,b=map(int,input().split())
    town[a-1]+=1
    town[b-1]+=1
if town.count(1)==2 and town.count(2)==2:
    print('YES')
else:
    print('NO')