def examA():
    N, K = LI()
    if (N+1)//2>=K:
        print("YES")
    else:
        print("NO")
    return

def examB():
    d = [0]*4
    for _ in range(3):
        a, b = LI()
        a -=1; b -=1
        d[a] +=1
        d[b] +=1
    for i in d:
        if i>=3 or i==0:
            print("NO")
            return
    print("YES")
    return

def examC():
    ans = 0
    print(ans)
    return

def examD():
    ans = 0
    print(ans)
    return

def examE():
    ans = 0
    print(ans)
    return

def examF():
    ans = 0
    print(ans)
    return

import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LFI(): return list(map(float,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
alphabet = [chr(ord('a') + i) for i in range(26)]

if __name__ == '__main__':
    examB()

"""

""" def examA():
    N, K = LI()
    if (N+1)//2>=K:
        print("YES")
    else:
        print("NO")
    return examA N, K = LI() N LI() LI K if (N+1)//2>=K:
        print("YES")
    else:
        print("NO")
     (N+1)//2>=K (N+1)//2 N+1 N 1 2 K print("YES") print "YES" print("NO") print "NO" return def examB():
    d = [0]*4
    for _ in range(3):
        a, b = LI()
        a -=1; b -=1
        d[a] +=1
        d[b] +=1
    for i in d:
        if i>=3 or i==0:
            print("NO")
            return
    print("YES")
    return examB d = [0]*4 d [0]*4 [0] 0 4 for _ in range(3):
        a, b = LI()
        a -=1; b -=1
        d[a] +=1
        d[b] +=1
     _ range(3) range 3 a, b = LI() a LI() LI b a -=1 a 1 b -=1 b 1 d[a] +=1 d[a] d a 1 d[b] +=1 d[b] d b 1 for i in d:
        if i>=3 or i==0:
            print("NO")
            return
     i d if i>=3 or i==0:
            print("NO")
            return
     i>=3 or i==0 i>=3 i 3 i==0 i 0 print("NO") print "NO" return print("YES") print "YES" return def examC():
    ans = 0
    print(ans)
    return examC ans = 0 ans 0 print(ans) print ans return def examD():
    ans = 0
    print(ans)
    return examD ans = 0 ans 0 print(ans) print ans return def examE():
    ans = 0
    print(ans)
    return examE ans = 0 ans 0 print(ans) print ans return def examF():
    ans = 0
    print(ans)
    return examF ans = 0 ans 0 print(ans) print ans return import sys,copy,bisect,itertools,heapq,math sys copy bisect itertools heapq math from heapq import heappop,heappush,heapify from collections import Counter,defaultdict,deque def I(): return int(sys.stdin.readline()) I def LI(): return list(map(int,sys.stdin.readline().split())) LI def LFI(): return list(map(float,sys.stdin.readline().split())) LFI def LSI(): return list(map(str,sys.stdin.readline().split())) LSI def LS(): return sys.stdin.readline().split() LS def SI(): return sys.stdin.readline().strip() SI global mod,mod2,inf,alphabet mod = 10**9 + 7 mod 10**9 + 7 10**9 10 9 7 mod2 = 998244353 mod2 998244353 inf = 10**18 inf 10**18 10 18 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 alphabet = [chr(ord('a') + i) for i in range(26)] alphabet [chr(ord('a') + i) for i in range(26)] if __name__ == '__main__':
    examB() __name__ == '__main__' __name__ '__main__' examB() examB """

""" def LFI(): return list(map(float,sys.stdin.readline().split())) def LFI(): return list(map(float,sys.stdin.readline().split())) LFI def LSI(): return list(map(str,sys.stdin.readline().split())) def LSI(): return list(map(str,sys.stdin.readline().split())) LSI global mod,mod2,inf,alphabet def I(): return int(sys.stdin.readline()) def I(): return int(sys.stdin.readline()) I def examF():
    ans = 0
    print(ans)
    return def examF():
    ans = 0
    print(ans)
    return examF def LS(): return sys.stdin.readline().split() def LS(): return sys.stdin.readline().split() LS def SI(): return sys.stdin.readline().strip() def SI(): return sys.stdin.readline().strip() SI mod2 = 998244353 998244353 mod2 def examB():
    d = [0]*4
    for _ in range(3):
        a, b = LI()
        a -=1; b -=1
        d[a] +=1
        d[b] +=1
    for i in d:
        if i>=3 or i==0:
            print("NO")
            return
    print("YES")
    return def examB():
    d = [0]*4
    for _ in range(3):
        a, b = LI()
        a -=1; b -=1
        d[a] +=1
        d[b] +=1
    for i in d:
        if i>=3 or i==0:
            print("NO")
            return
    print("YES")
    return examB inf = 10**18 10**18 inf alphabet = [chr(ord('a') + i) for i in range(26)] [chr(ord('a') + i) for i in range(26)] alphabet def examC():
    ans = 0
    print(ans)
    return def examC():
    ans = 0
    print(ans)
    return examC def examD():
    ans = 0
    print(ans)
    return def examD():
    ans = 0
    print(ans)
    return examD def LI(): return list(map(int,sys.stdin.readline().split())) def LI(): return list(map(int,sys.stdin.readline().split())) LI mod = 10**9 + 7 10**9 + 7 mod def examE():
    ans = 0
    print(ans)
    return def examE():
    ans = 0
    print(ans)
    return examE def examA():
    N, K = LI()
    if (N+1)//2>=K:
        print("YES")
    else:
        print("NO")
    return def examA():
    N, K = LI()
    if (N+1)//2>=K:
        print("YES")
    else:
        print("NO")
    return examA
def examA():
    N, K = LI()
    if (N+1)//2>=K:
        print("YES")
    else:
        print("NO")
    return

def examB():
    d = [0]*4
    for _ in range(3):
        a, b = LI()
        a -=1; b -=1
        d[a] +=1
        d[b] +=1
    for i in d:
        if i>=3 or i==0:
            print("NO")
            return
    print("YES")
    return

def examC():
    ans = 0
    print(ans)
    return

def examD():
    ans = 0
    print(ans)
    return

def examE():
    ans = 0
    print(ans)
    return

def examF():
    ans = 0
    print(ans)
    return

import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LFI(): return list(map(float,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
alphabet = [chr(ord('a') + i) for i in range(26)]

if __name__ == '__main__':
    examB()

"""

"""