#!/usr/bin/env python3
import sys

YES = "YES"  # type: str
NO = "NO"  # type: str


def solve(a: "List[int]", b: "List[int]"):
    ab = a+b
    t1 = [ab.count(1), ab.count(2), ab.count(3), ab.count(4)]
    
    if t1.count(1) == t1.count(2):
        print(YES)
    else:
        print(NO)

    return


# Generated by 1.1.5 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    a = [int()] * (3)  # type: "List[int]"
    b = [int()] * (3)  # type: "List[int]"
    for i in range(3):
        a[i] = int(next(tokens))
        b[i] = int(next(tokens))
    solve(a, b)

if __name__ == '__main__':
    main() import sys sys YES = "YES" YES "YES" NO = "NO" NO "NO" def solve(a: "List[int]", b: "List[int]"):
    ab = a+b
    t1 = [ab.count(1), ab.count(2), ab.count(3), ab.count(4)]
    
    if t1.count(1) == t1.count(2):
        print(YES)
    else:
        print(NO)

    return


# Generated by 1.1.5 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template) solve ab = a+b ab a+b a b t1 = [ab.count(1), ab.count(2), ab.count(3), ab.count(4)] t1 [ab.count(1), ab.count(2), ab.count(3), ab.count(4)] ab.count(1) ab.count ab count 1 ab.count(2) ab.count ab count 2 ab.count(3) ab.count ab count 3 ab.count(4) ab.count ab count 4 if t1.count(1) == t1.count(2):
        print(YES)
    else:
        print(NO)

     t1.count(1) == t1.count(2) t1.count(1) t1.count t1 count 1 t1.count(2) t1.count t1 count 2 print(YES) print YES print(NO) print NO return a: "List[int]" a b: "List[int]" b def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    a = [int()] * (3)  # type: "List[int]"
    b = [int()] * (3)  # type: "List[int]"
    for i in range(3):
        a[i] = int(next(tokens))
        b[i] = int(next(tokens))
    solve(a, b) main def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
     iterate_tokens for line in sys.stdin:
            for word in line.split():
                yield word
     line sys.stdin sys stdin for word in line.split():
                yield word
     word line.split() line.split line split yield word word tokens = iterate_tokens() tokens iterate_tokens() iterate_tokens a = [int()] * (3) a [int()] * (3) [int()] int() int 3 b = [int()] * (3) b [int()] * (3) [int()] int() int 3 for i in range(3):
        a[i] = int(next(tokens))
        b[i] = int(next(tokens))
     i range(3) range 3 a[i] = int(next(tokens)) a[i] a i int(next(tokens)) int next(tokens) next tokens b[i] = int(next(tokens)) b[i] b i int(next(tokens)) int next(tokens) next tokens solve(a, b) solve a b if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main YES = "YES" "YES" YES def solve(a: "List[int]", b: "List[int]"):
    ab = a+b
    t1 = [ab.count(1), ab.count(2), ab.count(3), ab.count(4)]
    
    if t1.count(1) == t1.count(2):
        print(YES)
    else:
        print(NO)

    return


# Generated by 1.1.5 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template) def solve(a: "List[int]", b: "List[int]"):
    ab = a+b
    t1 = [ab.count(1), ab.count(2), ab.count(3), ab.count(4)]
    
    if t1.count(1) == t1.count(2):
        print(YES)
    else:
        print(NO)

    return


# Generated by 1.1.5 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template) solve def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    a = [int()] * (3)  # type: "List[int]"
    b = [int()] * (3)  # type: "List[int]"
    for i in range(3):
        a[i] = int(next(tokens))
        b[i] = int(next(tokens))
    solve(a, b) def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    a = [int()] * (3)  # type: "List[int]"
    b = [int()] * (3)  # type: "List[int]"
    for i in range(3):
        a[i] = int(next(tokens))
        b[i] = int(next(tokens))
    solve(a, b) main NO = "NO" "NO" NO
#!/usr/bin/env python3
import sys

YES = "YES"  # type: str
NO = "NO"  # type: str


def solve(a: "List[int]", b: "List[int]"):
    ab = a+b
    t1 = [ab.count(1), ab.count(2), ab.count(3), ab.count(4)]
    
    if t1.count(1) == t1.count(2):
        print(YES)
    else:
        print(NO)

    return


# Generated by 1.1.5 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    a = [int()] * (3)  # type: "List[int]"
    b = [int()] * (3)  # type: "List[int]"
    for i in range(3):
        a[i] = int(next(tokens))
        b[i] = int(next(tokens))
    solve(a, b)

if __name__ == '__main__':
    main()
