#!/usr/bin/env python3
import sys

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

def solve(a: "List[int]", b: "List[int]"):
    count = [0] * 4
    for i in range(3):
        count[a[i] - 1] += 1
        count[b[i] - 1] += 1
    if max(count) >= 3:
        ret = NO
    else:
        ret = YES
    print(ret)
    return


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]"):
    count = [0] * 4
    for i in range(3):
        count[a[i] - 1] += 1
        count[b[i] - 1] += 1
    if max(count) >= 3:
        ret = NO
    else:
        ret = YES
    print(ret)
    return solve count = [0] * 4 count [0] * 4 [0] 0 4 for i in range(3):
        count[a[i] - 1] += 1
        count[b[i] - 1] += 1
     i range(3) range 3 count[a[i] - 1] += 1 count[a[i] - 1] count a[i] - 1 a[i] a i 1 1 count[b[i] - 1] += 1 count[b[i] - 1] count b[i] - 1 b[i] b i 1 1 if max(count) >= 3:
        ret = NO
    else:
        ret = YES
     max(count) >= 3 max(count) max count 3 ret = NO ret NO ret = YES ret YES print(ret) print ret 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 NO = "NO" "NO" NO def solve(a: "List[int]", b: "List[int]"):
    count = [0] * 4
    for i in range(3):
        count[a[i] - 1] += 1
        count[b[i] - 1] += 1
    if max(count) >= 3:
        ret = NO
    else:
        ret = YES
    print(ret)
    return def solve(a: "List[int]", b: "List[int]"):
    count = [0] * 4
    for i in range(3):
        count[a[i] - 1] += 1
        count[b[i] - 1] += 1
    if max(count) >= 3:
        ret = NO
    else:
        ret = YES
    print(ret)
    return solve YES = "YES" "YES" YES 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
#!/usr/bin/env python3
import sys

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

def solve(a: "List[int]", b: "List[int]"):
    count = [0] * 4
    for i in range(3):
        count[a[i] - 1] += 1
        count[b[i] - 1] += 1
    if max(count) >= 3:
        ret = NO
    else:
        ret = YES
    print(ret)
    return


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()
