x(X):-current_input(I),read_string(I,' \n','',_,X).
n(N):-x(X),number_string(N,X).
ns(0,[]):-!.
ns(I,[N|A]):-n(N),I1 is I-1,ns(I1,A).
s(0):- writeln("No"),!.
s(N):- 7 is N mod 10,writeln("Yes"),!.
s(N):- N1 is N div 10,s(N1).
main:-
        n(N),s(N).
