import sys
readline = sys.stdin.buffer.readline
def even(n): return 1 if n%2==0 else 0
from collections import defaultdict
dic1 = defaultdict(int)
for i in range(3):
    n,m = map(int,readline().split())
    dic1[n] += 1
    dic1[m] += 1

lst1 = list(dic1.values())
lst1.sort()

if lst1 == [1,1,2,2]:
    print("YES")
else:
    print("NO") import sys sys readline = sys.stdin.buffer.readline readline sys.stdin.buffer.readline sys.stdin.buffer sys.stdin sys stdin buffer readline def even(n): return 1 if n%2==0 else 0 even n n from collections import defaultdict dic1 = defaultdict(int) dic1 defaultdict(int) defaultdict int for i in range(3):
    n,m = map(int,readline().split())
    dic1[n] += 1
    dic1[m] += 1 i range(3) range 3 n,m = map(int,readline().split()) n map(int,readline().split()) map int readline().split() ().split () readline split m dic1[n] += 1 dic1[n] dic1 n 1 dic1[m] += 1 dic1[m] dic1 m 1 lst1 = list(dic1.values()) lst1 list(dic1.values()) list dic1.values() dic1.values dic1 values lst1.sort() lst1.sort lst1 sort if lst1 == [1,1,2,2]:
    print("YES")
else:
    print("NO") lst1 == [1,1,2,2] lst1 [1,1,2,2] 1 1 2 2 print("YES") print "YES" print("NO") print "NO" dic1 = defaultdict(int) defaultdict(int) dic1 readline = sys.stdin.buffer.readline sys.stdin.buffer.readline readline n,m = map(int,readline().split()) map(int,readline().split()) n def even(n): return 1 if n%2==0 else 0 def even(n): return 1 if n%2==0 else 0 even m = map(int,readline().split()) map(int,readline().split()) m lst1 = list(dic1.values()) list(dic1.values()) lst1
import sys
readline = sys.stdin.buffer.readline
def even(n): return 1 if n%2==0 else 0
from collections import defaultdict
dic1 = defaultdict(int)
for i in range(3):
    n,m = map(int,readline().split())
    dic1[n] += 1
    dic1[m] += 1

lst1 = list(dic1.values())
lst1.sort()

if lst1 == [1,1,2,2]:
    print("YES")
else:
    print("NO")