S = eval(input())

print(("Yes" if(S.count('7') > 0) else "No"))
print((["No","Yes"]["7" in eval(input())]))
S = eval(input())
print(("Yes" if (S.count("7") > 0) else "No"))

print((["No", "Yes"]["7" in eval(input())]))

-S = eval(input()) -print(("Yes" if (S.count("7") > 0) else "No")) +print((["No", "Yes"]["7" in eval(input())]))