
def main():
    a = [0 for i in range(5)]

    for i in range(3):
        x, y = map(int, input().split())
        a[x] += 1
        a[y] += 1

    flg = 1
    odd_flg = 0
    for i in range(1, 5):
        if a[i] == 0:
            flg = 0
        if a[i] % 2 == 1:
            odd_flg += 1

    if odd_flg > 2:
        flg = 0

    if flg:
        print('YES')
    else:
        print('NO')





if __name__ == '__main__':
    main() def main():
    a = [0 for i in range(5)]

    for i in range(3):
        x, y = map(int, input().split())
        a[x] += 1
        a[y] += 1

    flg = 1
    odd_flg = 0
    for i in range(1, 5):
        if a[i] == 0:
            flg = 0
        if a[i] % 2 == 1:
            odd_flg += 1

    if odd_flg > 2:
        flg = 0

    if flg:
        print('YES')
    else:
        print('NO') main 0 for i in range(5) for i in range(5) i range(5) range 5 for i in range(5) 0 a = [0 for i in range(5)] a [0 for i in range(5)] for i in range(3):
        x, y = map(int, input().split())
        a[x] += 1
        a[y] += 1

     i range(3) range 3 x, y = map(int, input().split()) x map(int, input().split()) map int input().split() ().split () input split y a[x] += 1 a[x] a x 1 a[y] += 1 a[y] a y 1 flg = 1 flg 1 odd_flg = 0 odd_flg 0 for i in range(1, 5):
        if a[i] == 0:
            flg = 0
        if a[i] % 2 == 1:
            odd_flg += 1

     i range(1, 5) range 1 5 if a[i] == 0:
            flg = 0
         a[i] == 0 a[i] a i 0 flg = 0 flg 0 if a[i] % 2 == 1:
            odd_flg += 1

     a[i] % 2 == 1 a[i] % 2 a[i] a i 2 1 odd_flg += 1 odd_flg 1 if odd_flg > 2:
        flg = 0

     odd_flg > 2 odd_flg 2 flg = 0 flg 0 if flg:
        print('YES')
    else:
        print('NO') flg print('YES') print 'YES' print('NO') print 'NO' if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    a = [0 for i in range(5)]

    for i in range(3):
        x, y = map(int, input().split())
        a[x] += 1
        a[y] += 1

    flg = 1
    odd_flg = 0
    for i in range(1, 5):
        if a[i] == 0:
            flg = 0
        if a[i] % 2 == 1:
            odd_flg += 1

    if odd_flg > 2:
        flg = 0

    if flg:
        print('YES')
    else:
        print('NO') def main():
    a = [0 for i in range(5)]

    for i in range(3):
        x, y = map(int, input().split())
        a[x] += 1
        a[y] += 1

    flg = 1
    odd_flg = 0
    for i in range(1, 5):
        if a[i] == 0:
            flg = 0
        if a[i] % 2 == 1:
            odd_flg += 1

    if odd_flg > 2:
        flg = 0

    if flg:
        print('YES')
    else:
        print('NO') main

def main():
    a = [0 for i in range(5)]

    for i in range(3):
        x, y = map(int, input().split())
        a[x] += 1
        a[y] += 1

    flg = 1
    odd_flg = 0
    for i in range(1, 5):
        if a[i] == 0:
            flg = 0
        if a[i] % 2 == 1:
            odd_flg += 1

    if odd_flg > 2:
        flg = 0

    if flg:
        print('YES')
    else:
        print('NO')





if __name__ == '__main__':
    main()