import sys

input = sys.stdin.readline


def main():
    count = [0, 0, 0, 0]
    for _ in range(3):
        a, b = map(int, input().split())
        a -= 1
        b -= 1
        count[a] += 1
        count[b] += 1

    if count.count(1) == 2 and count.count(2) == 2:
        ans = "YES"
    else:
        ans = "NO"

    print(ans)


if __name__ == "__main__":
    main() import sys sys input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline def main():
    count = [0, 0, 0, 0]
    for _ in range(3):
        a, b = map(int, input().split())
        a -= 1
        b -= 1
        count[a] += 1
        count[b] += 1

    if count.count(1) == 2 and count.count(2) == 2:
        ans = "YES"
    else:
        ans = "NO"

    print(ans) main count = [0, 0, 0, 0] count [0, 0, 0, 0] 0 0 0 0 for _ in range(3):
        a, b = map(int, input().split())
        a -= 1
        b -= 1
        count[a] += 1
        count[b] += 1

     _ range(3) range 3 a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b a -= 1 a 1 b -= 1 b 1 count[a] += 1 count[a] count a 1 count[b] += 1 count[b] count b 1 if count.count(1) == 2 and count.count(2) == 2:
        ans = "YES"
    else:
        ans = "NO"

     count.count(1) == 2 and count.count(2) == 2 count.count(1) == 2 count.count(1) count.count count count 1 2 count.count(2) == 2 count.count(2) count.count count count 2 2 ans = "YES" ans "YES" ans = "NO" ans "NO" print(ans) print ans if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main input = sys.stdin.readline sys.stdin.readline input def main():
    count = [0, 0, 0, 0]
    for _ in range(3):
        a, b = map(int, input().split())
        a -= 1
        b -= 1
        count[a] += 1
        count[b] += 1

    if count.count(1) == 2 and count.count(2) == 2:
        ans = "YES"
    else:
        ans = "NO"

    print(ans) def main():
    count = [0, 0, 0, 0]
    for _ in range(3):
        a, b = map(int, input().split())
        a -= 1
        b -= 1
        count[a] += 1
        count[b] += 1

    if count.count(1) == 2 and count.count(2) == 2:
        ans = "YES"
    else:
        ans = "NO"

    print(ans) main
import sys

input = sys.stdin.readline


def main():
    count = [0, 0, 0, 0]
    for _ in range(3):
        a, b = map(int, input().split())
        a -= 1
        b -= 1
        count[a] += 1
        count[b] += 1

    if count.count(1) == 2 and count.count(2) == 2:
        ans = "YES"
    else:
        ans = "NO"

    print(ans)


if __name__ == "__main__":
    main()
