Language: C++

import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
inf = float('inf')
ninf = -float('inf')
 
#整数input
def ii(): return int(sys.stdin.readline().rstrip()) #int(input())
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) #list(map(int,input().split()))
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]
#文字列input
def ss(): return sys.stdin.readline().rstrip() #input()
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) #list(input().split())
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]

#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？

route =[0]*4
for i in range(3):
    a,b=mii()
    route[a-1]+=1
    route[b-1]+=1

cou = Counter(route)

ans1=0
ans2=0
for i in route:
    if i==1:
        ans1+=1
    elif i==2:
        ans2+=1

if ans1==2 and ans2==2:
    print("YES")
else:
    print("NO")



Compiler output:
a.cc:12:13: warning: multi-character character constant [-Wmultichar]
   12 | inf = float('inf')
      |             ^~~~~
a.cc:13:15: warning: multi-character character constant [-Wmultichar]
   13 | ninf = -float('inf')
      |               ^~~~~
a.cc:15:2: error: invalid preprocessing directive #\U00006574\U00006570input
   15 | #整数input
      |  ^~~~~~~~~
a.cc:16:53: error: stray '#' in program
   16 | def ii(): return int(sys.stdin.readline().rstrip()) #int(input())
      |                                                     ^
a.cc:18:33: error: stray '#' in program
   18 | def limii(): return list(mii()) #list(map(int,input().split()))
      |                                 ^
a.cc:21:2: error: invalid preprocessing directive #\U00006587\U00005b57\U00005217input
   21 | #文字列input
      |  ^~~~~~~~~~~
a.cc:22:48: error: stray '#' in program
   22 | def ss(): return sys.stdin.readline().rstrip() #input()
      |                                                ^
a.cc:24:33: error: stray '#' in program
   24 | def limss(): return list(mss()) #list(input().split())
      |                                 ^
a.cc:28:2: error: invalid preprocessing directive #\U0000672c\U00005f53\U0000306b\U00008caa\U00006b32\U00006cd5\U0000304b\U0000ff1f
   28 | #本当に貪欲法か？ DP法では？？
      |  ^~~~~~~~~~~~~~~~
a.cc:29:2: error: invalid preprocessing directive #\U0000672c\U00005f53\U0000306b\U00008caa\U00006b32\U00006cd5\U0000304b\U0000ff1f
   29 | #本当に貪欲法か？ DP法では？？
      |  ^~~~~~~~~~~~~~~~
a.cc:30:2: error: invalid preprocessing directive #\U0000672c\U00005f53\U0000306b\U00008caa\U00006b32\U00006cd5\U0000304b\U0000ff1f
   30 | #本当に貪欲法か？ DP法では？？
      |  ^~~~~~~~~~~~~~~~
a.cc:1:1: error: 'import' does not name a type
    1 | import sys
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'