'''
Created on 2020/08/21

@author: harurun
'''
def main():
  import sys
  pin=sys.stdin.readline
  pout=sys.stdout.write
  perr=sys.stderr.write
  
  l=[0]*4
  for i in range(3):
    a,b=map(int,pin().split())
    l[a-1]+=1
    l[b-1]+=1
  t=sorted(list(set(l)))
  if t==[1,2]:
    print("YES")
  else:
    print("NO")
  return 

main() '''
Created on 2020/08/21

@author: harurun
''' def main():
  import sys
  pin=sys.stdin.readline
  pout=sys.stdout.write
  perr=sys.stderr.write
  
  l=[0]*4
  for i in range(3):
    a,b=map(int,pin().split())
    l[a-1]+=1
    l[b-1]+=1
  t=sorted(list(set(l)))
  if t==[1,2]:
    print("YES")
  else:
    print("NO")
  return  main import sys sys pin=sys.stdin.readline pin sys.stdin.readline sys.stdin sys stdin readline pout=sys.stdout.write pout sys.stdout.write sys.stdout sys stdout write perr=sys.stderr.write perr sys.stderr.write sys.stderr sys stderr write l=[0]*4 l [0]*4 [0] 0 4 for i in range(3):
    a,b=map(int,pin().split())
    l[a-1]+=1
    l[b-1]+=1
   i range(3) range 3 a,b=map(int,pin().split()) a map(int,pin().split()) map int pin().split() ().split () pin split b l[a-1]+=1 l[a-1] l a-1 a 1 1 l[b-1]+=1 l[b-1] l b-1 b 1 1 t=sorted(list(set(l))) t sorted(list(set(l))) sorted list(set(l)) list set(l) set l if t==[1,2]:
    print("YES")
  else:
    print("NO")
   t==[1,2] t [1,2] 1 2 print("YES") print "YES" print("NO") print "NO" return main() main def main():
  import sys
  pin=sys.stdin.readline
  pout=sys.stdout.write
  perr=sys.stderr.write
  
  l=[0]*4
  for i in range(3):
    a,b=map(int,pin().split())
    l[a-1]+=1
    l[b-1]+=1
  t=sorted(list(set(l)))
  if t==[1,2]:
    print("YES")
  else:
    print("NO")
  return  def main():
  import sys
  pin=sys.stdin.readline
  pout=sys.stdout.write
  perr=sys.stderr.write
  
  l=[0]*4
  for i in range(3):
    a,b=map(int,pin().split())
    l[a-1]+=1
    l[b-1]+=1
  t=sorted(list(set(l)))
  if t==[1,2]:
    print("YES")
  else:
    print("NO")
  return  main
'''
Created on 2020/08/21

@author: harurun
'''
def main():
  import sys
  pin=sys.stdin.readline
  pout=sys.stdout.write
  perr=sys.stderr.write
  
  l=[0]*4
  for i in range(3):
    a,b=map(int,pin().split())
    l[a-1]+=1
    l[b-1]+=1
  t=sorted(list(set(l)))
  if t==[1,2]:
    print("YES")
  else:
    print("NO")
  return 

main()