n=eval(input())

print(('Yes' if '7' in n else 'No'))
print(('Yes' if '7' in eval(input()) else 'No'))
n = eval(input())
print(("Yes" if "7" in n else "No"))

print(("Yes" if "7" in eval(input()) else "No"))

-n = eval(input()) -print(("Yes" if "7" in n else "No")) +print(("Yes" if "7" in eval(input()) else "No"))