arr = list(map(int,input().split()))



b = [0]*10



for i in arr:

    b[i-1] += 1



if (b[4]==2 and b[6]==1):

    print("YES")

else:

    print("NO")



a, b, c = list(map(int, input().split()))

if a==5 and b==5 and c==7 or a==5 and b==7 and c==5 or a==7 and b==5 and c==5:

    print('YES')

else:

    print('NO')
arr = list(map(int, input().split()))
b = [0] * 10
for i in arr:
    b[i - 1] += 1
if b[4] == 2 and b[6] == 1:
    print("YES")
else:
    print("NO")

a, b, c = list(map(int, input().split()))
if (
    a == 5
    and b == 5
    and c == 7
    or a == 5
    and b == 7
    and c == 5
    or a == 7
    and b == 5
    and c == 5
):
    print("YES")
else:
    print("NO")

-arr = list(map(int, input().split())) -b = [0] * 10 -for i in arr: -    b[i - 1] += 1 -if b[4] == 2 and b[6] == 1: +a, b, c = list(map(int, input().split())) +if ( +    a == 5 +    and b == 5 +    and c == 7 +    or a == 5 +    and b == 7 +    and c == 5 +    or a == 7 +    and b == 5 +    and c == 5 +):