###template###
import sys
def input(): return sys.stdin.readline().rstrip()
def mi(): return map(int, input().split())
###template###

a = list(mi()) + list(mi()) + list(mi())
cnts = [a.count(i) for i in range(1,5)]

if max(cnts) == 3: print('NO')
else: print('YES')
 import sys sys def input(): return sys.stdin.readline().rstrip() input def mi(): return map(int, input().split())
###template### mi a = list(mi()) + list(mi()) + list(mi()) a list(mi()) + list(mi()) + list(mi()) list(mi()) + list(mi()) list(mi()) list mi() mi list(mi()) list mi() mi list(mi()) list mi() mi a.count(i) for i in range(1,5) for i in range(1,5) i range(1,5) range 1 5 for i in range(1,5) a.count(i) a.count a count i cnts = [a.count(i) for i in range(1,5)] cnts [a.count(i) for i in range(1,5)] if max(cnts) == 3: print('NO')
else: print('YES') max(cnts) == 3 max(cnts) max cnts 3 def mi(): return map(int, input().split())
###template### def mi(): return map(int, input().split())
###template### mi cnts = [a.count(i) for i in range(1,5)] [a.count(i) for i in range(1,5)] cnts def input(): return sys.stdin.readline().rstrip() def input(): return sys.stdin.readline().rstrip() input a = list(mi()) + list(mi()) + list(mi()) list(mi()) + list(mi()) + list(mi()) a
###template###
import sys
def input(): return sys.stdin.readline().rstrip()
def mi(): return map(int, input().split())
###template###

a = list(mi()) + list(mi()) + list(mi())
cnts = [a.count(i) for i in range(1,5)]

if max(cnts) == 3: print('NO')
else: print('YES')

