import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees#, log2, log
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
from decimal import Decimal
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10**9 + 7
from decimal import *

a = []
for _ in range(3):
	a.extend(LIST())

C = sorted(Counter(a).values())

print("YES" if C == [1, 1, 2, 2] else "NO") import sys, re sys re from collections import deque, defaultdict, Counter from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby from operator import itemgetter, mul from copy import deepcopy from string import ascii_lowercase, ascii_uppercase, digits from bisect import bisect, bisect_left, insort, insort_left from fractions import gcd from heapq import heappush, heappop from functools import reduce from decimal import Decimal def input(): return sys.stdin.readline().strip() input def INT(): return int(input()) INT def MAP(): return map(int, input().split()) MAP def LIST(): return list(map(int, input().split())) LIST MAP() for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) MAP() MAP def ZIP(n): return zip(*(MAP() for _ in range(n))) ZIP n n sys.setrecursionlimit(10 ** 9) sys.setrecursionlimit sys setrecursionlimit 10 ** 9 10 9 INF = float('inf') INF float('inf') float 'inf' mod = 10**9 + 7 mod 10**9 + 7 10**9 10 9 7 from decimal import * a = [] a [] for _ in range(3):
	a.extend(LIST()) _ range(3) range 3 a.extend(LIST()) a.extend a extend LIST() LIST C = sorted(Counter(a).values()) C sorted(Counter(a).values()) sorted Counter(a).values() (a).values (a) Counter a values print("YES" if C == [1, 1, 2, 2] else "NO") print "YES" if C == [1, 1, 2, 2] else "NO" C == [1, 1, 2, 2] C [1, 1, 2, 2] 1 1 2 2 "YES" "NO" mod = 10**9 + 7 10**9 + 7 mod def INT(): return int(input()) def INT(): return int(input()) INT a = [] [] a INF = float('inf') float('inf') INF def LIST(): return list(map(int, input().split())) def LIST(): return list(map(int, input().split())) LIST def input(): return sys.stdin.readline().strip() def input(): return sys.stdin.readline().strip() input def MAP(): return map(int, input().split()) def MAP(): return map(int, input().split()) MAP C = sorted(Counter(a).values()) sorted(Counter(a).values()) C def ZIP(n): return zip(*(MAP() for _ in range(n))) def ZIP(n): return zip(*(MAP() for _ in range(n))) ZIP
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees#, log2, log
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
from decimal import Decimal
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10**9 + 7
from decimal import *

a = []
for _ in range(3):
	a.extend(LIST())

C = sorted(Counter(a).values())

print("YES" if C == [1, 1, 2, 2] else "NO")
