import collections as cl

# 全街のつながりは保証されていて、橋は3本固定なので、枝分かれしてなければたどり着けるはず
def main() :
    bridges = []
    for i in range(3) :
        in_list = [int(i) for i in input().split()]
        bridges.extend(in_list)
    
    c = cl.Counter(bridges)
    com = c.most_common()
    if (com[0][1] == 2 and com[1][1] == 2 and com[2][1] == 1 and com[3][1] == 1) :
        print("YES")
    else :
        print("NO")
        
        
    






main() import collections as cl collections def main() :
    bridges = []
    for i in range(3) :
        in_list = [int(i) for i in input().split()]
        bridges.extend(in_list)
    
    c = cl.Counter(bridges)
    com = c.most_common()
    if (com[0][1] == 2 and com[1][1] == 2 and com[2][1] == 1 and com[3][1] == 1) :
        print("YES")
    else :
        print("NO")
        
        
     main bridges = [] bridges [] for i in range(3) :
        in_list = [int(i) for i in input().split()]
        bridges.extend(in_list)
    
     i range(3) range 3 int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i in_list = [int(i) for i in input().split()] in_list [int(i) for i in input().split()] bridges.extend(in_list) bridges.extend bridges extend in_list c = cl.Counter(bridges) c cl.Counter(bridges) cl.Counter cl Counter bridges com = c.most_common() com c.most_common() c.most_common c most_common if (com[0][1] == 2 and com[1][1] == 2 and com[2][1] == 1 and com[3][1] == 1) :
        print("YES")
    else :
        print("NO")
        
        
     com[0][1] == 2 and com[1][1] == 2 and com[2][1] == 1 and com[3][1] == 1 com[0][1] == 2 and com[1][1] == 2 and com[2][1] == 1 com[0][1] == 2 and com[1][1] == 2 com[0][1] == 2 com[0][1] [0] com 0 1 2 com[1][1] == 2 com[1][1] [1] com 1 1 2 com[2][1] == 1 com[2][1] [2] com 2 1 1 com[3][1] == 1 com[3][1] [3] com 3 1 1 print("YES") print "YES" print("NO") print "NO" main() main def main() :
    bridges = []
    for i in range(3) :
        in_list = [int(i) for i in input().split()]
        bridges.extend(in_list)
    
    c = cl.Counter(bridges)
    com = c.most_common()
    if (com[0][1] == 2 and com[1][1] == 2 and com[2][1] == 1 and com[3][1] == 1) :
        print("YES")
    else :
        print("NO")
        
        
     def main() :
    bridges = []
    for i in range(3) :
        in_list = [int(i) for i in input().split()]
        bridges.extend(in_list)
    
    c = cl.Counter(bridges)
    com = c.most_common()
    if (com[0][1] == 2 and com[1][1] == 2 and com[2][1] == 1 and com[3][1] == 1) :
        print("YES")
    else :
        print("NO")
        
        
     main
import collections as cl

# 全街のつながりは保証されていて、橋は3本固定なので、枝分かれしてなければたどり着けるはず
def main() :
    bridges = []
    for i in range(3) :
        in_list = [int(i) for i in input().split()]
        bridges.extend(in_list)
    
    c = cl.Counter(bridges)
    com = c.most_common()
    if (com[0][1] == 2 and com[1][1] == 2 and com[2][1] == 1 and com[3][1] == 1) :
        print("YES")
    else :
        print("NO")
        
        
    






main()