import sys
import collections
import bisect


def main():
    k = [list(map(int, input().split())) for _ in range(3)]

    c = collections.Counter(k[0] + k[1] + k[2])
    print('YES' if sorted(c.values()) == [1, 1, 2, 2] else 'NO')


if __name__ == '__main__':
    main() import sys sys import collections collections import bisect bisect def main():
    k = [list(map(int, input().split())) for _ in range(3)]

    c = collections.Counter(k[0] + k[1] + k[2])
    print('YES' if sorted(c.values()) == [1, 1, 2, 2] else 'NO') main list(map(int, input().split())) for _ in range(3) for _ in range(3) _ range(3) range 3 for _ in range(3) list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split k = [list(map(int, input().split())) for _ in range(3)] k [list(map(int, input().split())) for _ in range(3)] c = collections.Counter(k[0] + k[1] + k[2]) c collections.Counter(k[0] + k[1] + k[2]) collections.Counter collections Counter k[0] + k[1] + k[2] k[0] + k[1] k[0] k 0 k[1] k 1 k[2] k 2 print('YES' if sorted(c.values()) == [1, 1, 2, 2] else 'NO') print 'YES' if sorted(c.values()) == [1, 1, 2, 2] else 'NO' sorted(c.values()) == [1, 1, 2, 2] sorted(c.values()) sorted c.values() c.values c values [1, 1, 2, 2] 1 1 2 2 'YES' 'NO' if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    k = [list(map(int, input().split())) for _ in range(3)]

    c = collections.Counter(k[0] + k[1] + k[2])
    print('YES' if sorted(c.values()) == [1, 1, 2, 2] else 'NO') def main():
    k = [list(map(int, input().split())) for _ in range(3)]

    c = collections.Counter(k[0] + k[1] + k[2])
    print('YES' if sorted(c.values()) == [1, 1, 2, 2] else 'NO') main
import sys
import collections
import bisect


def main():
    k = [list(map(int, input().split())) for _ in range(3)]

    c = collections.Counter(k[0] + k[1] + k[2])
    print('YES' if sorted(c.values()) == [1, 1, 2, 2] else 'NO')


if __name__ == '__main__':
    main()
