n = eval(input())

print(("YNeos"["7" not in n::2]))
print(("YNeos"["7" not in eval(input())::2]))

n = eval(input())
print(("YNeos"["7" not in n :: 2]))

print(("YNeos"["7" not in eval(input()) :: 2]))

-n = eval(input()) -print(("YNeos"["7" not in n :: 2])) +print(("YNeos"["7" not in eval(input()) :: 2]))