#!/usr/bin/env python3

from sys import stdin, setrecursionlimit


def main():
    input = stdin.buffer.readline
    ab = [list(map(int, input().split())) for _ in range(3)]
    count = [0] * 4
    for a, b in ab:
        count[a - 1] += 1
        count[b - 1] += 1
    if count.count(3) >= 1:
        print('NO')
    else:
        print("YES")


if __name__ == "__main__":
    setrecursionlimit(10000)
    main() from sys import stdin, setrecursionlimit def main():
    input = stdin.buffer.readline
    ab = [list(map(int, input().split())) for _ in range(3)]
    count = [0] * 4
    for a, b in ab:
        count[a - 1] += 1
        count[b - 1] += 1
    if count.count(3) >= 1:
        print('NO')
    else:
        print("YES") main input = stdin.buffer.readline input stdin.buffer.readline stdin.buffer stdin buffer readline 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 ab = [list(map(int, input().split())) for _ in range(3)] ab [list(map(int, input().split())) for _ in range(3)] count = [0] * 4 count [0] * 4 [0] 0 4 for a, b in ab:
        count[a - 1] += 1
        count[b - 1] += 1
     a b ab count[a - 1] += 1 count[a - 1] count a - 1 a 1 1 count[b - 1] += 1 count[b - 1] count b - 1 b 1 1 if count.count(3) >= 1:
        print('NO')
    else:
        print("YES") count.count(3) >= 1 count.count(3) count.count count count 3 1 print('NO') print 'NO' print("YES") print "YES" if __name__ == "__main__":
    setrecursionlimit(10000)
    main() __name__ == "__main__" __name__ "__main__" setrecursionlimit(10000) setrecursionlimit 10000 main() main def main():
    input = stdin.buffer.readline
    ab = [list(map(int, input().split())) for _ in range(3)]
    count = [0] * 4
    for a, b in ab:
        count[a - 1] += 1
        count[b - 1] += 1
    if count.count(3) >= 1:
        print('NO')
    else:
        print("YES") def main():
    input = stdin.buffer.readline
    ab = [list(map(int, input().split())) for _ in range(3)]
    count = [0] * 4
    for a, b in ab:
        count[a - 1] += 1
        count[b - 1] += 1
    if count.count(3) >= 1:
        print('NO')
    else:
        print("YES") main
#!/usr/bin/env python3

from sys import stdin, setrecursionlimit


def main():
    input = stdin.buffer.readline
    ab = [list(map(int, input().split())) for _ in range(3)]
    count = [0] * 4
    for a, b in ab:
        count[a - 1] += 1
        count[b - 1] += 1
    if count.count(3) >= 1:
        print('NO')
    else:
        print("YES")


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()
