import bisect
import copy
import heapq
import math
import sys
from collections import *
from functools import lru_cache
from itertools import accumulate, combinations, permutations, product
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
sys.setrecursionlimit(500000)
mod=pow(10,9)+7
al=[chr(ord('a') + i) for i in range(26)]
direction=[[1,0],[0,1],[-1,0],[0,-1]]

ab=[list(map(int,input().split())) for i in range(3)]
lst=[0]*4
for i in range(3):
    a,b=ab[i]
    lst[a-1]+=1
    lst[b-1]+=1

for i in range(4):
    if lst[i]==0 or lst[i]==3:
        print("NO")
        break
else:
    print("YES") import bisect bisect import copy copy import heapq heapq import math math import sys sys from collections import * from functools import lru_cache from itertools import accumulate, combinations, permutations, product def input():
    return sys.stdin.readline()[:-1] input return sys.stdin.readline()[:-1] sys.stdin.readline()[:-1] sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline :-1 -1 def ruiseki(lst):
    return [0]+list(accumulate(lst)) ruiseki return [0]+list(accumulate(lst)) [0]+list(accumulate(lst)) [0] 0 list(accumulate(lst)) list accumulate(lst) accumulate lst lst lst sys.setrecursionlimit(500000) sys.setrecursionlimit sys setrecursionlimit 500000 mod=pow(10,9)+7 mod pow(10,9)+7 pow(10,9) pow 10 9 7 chr(ord('a') + i) for i in range(26) for i in range(26) i range(26) range 26 for i in range(26) chr(ord('a') + i) chr ord('a') + i ord('a') ord 'a' i al=[chr(ord('a') + i) for i in range(26)] al [chr(ord('a') + i) for i in range(26)] direction=[[1,0],[0,1],[-1,0],[0,-1]] direction [[1,0],[0,1],[-1,0],[0,-1]] [1,0] 1 0 [0,1] 0 1 [-1,0] -1 0 [0,-1] 0 -1 list(map(int,input().split())) for i in range(3) for i in range(3) i range(3) range 3 for i in range(3) list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split ab=[list(map(int,input().split())) for i in range(3)] ab [list(map(int,input().split())) for i in range(3)] lst=[0]*4 lst [0]*4 [0] 0 4 for i in range(3):
    a,b=ab[i]
    lst[a-1]+=1
    lst[b-1]+=1 i range(3) range 3 a,b=ab[i] a ab[i] ab i b lst[a-1]+=1 lst[a-1] lst a-1 a 1 1 lst[b-1]+=1 lst[b-1] lst b-1 b 1 1 for i in range(4):
    if lst[i]==0 or lst[i]==3:
        print("NO")
        break
else:
    print("YES") i range(4) range 4 if lst[i]==0 or lst[i]==3:
        print("NO")
        break lst[i]==0 or lst[i]==3 lst[i]==0 lst[i] lst i 0 lst[i]==3 lst[i] lst i 3 print("NO") print "NO" break print("YES") print "YES" def ruiseki(lst):
    return [0]+list(accumulate(lst)) def ruiseki(lst):
    return [0]+list(accumulate(lst)) ruiseki al=[chr(ord('a') + i) for i in range(26)] [chr(ord('a') + i) for i in range(26)] al direction=[[1,0],[0,1],[-1,0],[0,-1]] [[1,0],[0,1],[-1,0],[0,-1]] direction ab=[list(map(int,input().split())) for i in range(3)] [list(map(int,input().split())) for i in range(3)] ab b=ab[i] ab[i] b lst=[0]*4 [0]*4 lst a,b=ab[i] ab[i] a def input():
    return sys.stdin.readline()[:-1] def input():
    return sys.stdin.readline()[:-1] input mod=pow(10,9)+7 pow(10,9)+7 mod
import bisect
import copy
import heapq
import math
import sys
from collections import *
from functools import lru_cache
from itertools import accumulate, combinations, permutations, product
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
sys.setrecursionlimit(500000)
mod=pow(10,9)+7
al=[chr(ord('a') + i) for i in range(26)]
direction=[[1,0],[0,1],[-1,0],[0,-1]]

ab=[list(map(int,input().split())) for i in range(3)]
lst=[0]*4
for i in range(3):
    a,b=ab[i]
    lst[a-1]+=1
    lst[b-1]+=1

for i in range(4):
    if lst[i]==0 or lst[i]==3:
        print("NO")
        break
else:
    print("YES")