def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7

    a,b = map(int, input().split())
    c,d = map(int, input().split())
    e,f = map(int, input().split())
    c = Counter([a,b,c,d,e,f])
    a = 0
    b = 0
    for i in c.values():
        if i==1:
            a+=1
        if i==2:
            b+=1
    if a==2 and b==2:
        print('YES')
    else:
        print('NO')

if __name__ == '__main__':
    main() def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7

    a,b = map(int, input().split())
    c,d = map(int, input().split())
    e,f = map(int, input().split())
    c = Counter([a,b,c,d,e,f])
    a = 0
    b = 0
    for i in c.values():
        if i==1:
            a+=1
        if i==2:
            b+=1
    if a==2 and b==2:
        print('YES')
    else:
        print('NO') main import sys sys input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline sys.setrecursionlimit(10**7) sys.setrecursionlimit sys setrecursionlimit 10**7 10 7 from collections import Counter, deque from itertools import combinations, permutations, accumulate, groupby, product from bisect import bisect_left,bisect_right from heapq import heapify, heappop, heappush from math import floor, ceil a,b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b c,d = map(int, input().split()) c map(int, input().split()) map int input().split() ().split () input split d e,f = map(int, input().split()) e map(int, input().split()) map int input().split() ().split () input split f c = Counter([a,b,c,d,e,f]) c Counter([a,b,c,d,e,f]) Counter [a,b,c,d,e,f] a b c d e f a = 0 a 0 b = 0 b 0 for i in c.values():
        if i==1:
            a+=1
        if i==2:
            b+=1
     i c.values() c.values c values if i==1:
            a+=1
         i==1 i 1 a+=1 a 1 if i==2:
            b+=1
     i==2 i 2 b+=1 b 1 if a==2 and b==2:
        print('YES')
    else:
        print('NO') a==2 and b==2 a==2 a 2 b==2 b 2 print('YES') print 'YES' print('NO') print 'NO' if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7

    a,b = map(int, input().split())
    c,d = map(int, input().split())
    e,f = map(int, input().split())
    c = Counter([a,b,c,d,e,f])
    a = 0
    b = 0
    for i in c.values():
        if i==1:
            a+=1
        if i==2:
            b+=1
    if a==2 and b==2:
        print('YES')
    else:
        print('NO') def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7

    a,b = map(int, input().split())
    c,d = map(int, input().split())
    e,f = map(int, input().split())
    c = Counter([a,b,c,d,e,f])
    a = 0
    b = 0
    for i in c.values():
        if i==1:
            a+=1
        if i==2:
            b+=1
    if a==2 and b==2:
        print('YES')
    else:
        print('NO') main
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7

    a,b = map(int, input().split())
    c,d = map(int, input().split())
    e,f = map(int, input().split())
    c = Counter([a,b,c,d,e,f])
    a = 0
    b = 0
    for i in c.values():
        if i==1:
            a+=1
        if i==2:
            b+=1
    if a==2 and b==2:
        print('YES')
    else:
        print('NO')

if __name__ == '__main__':
    main()