program treeorfive
var b, n : integer;
begin
readln(n);
b:=0;
while (n>0) and (b=0) do
if (n mod 10=5) or (n mod 10=3)then b:=1
else if (n div 10=5) or (n div 10=3) then b:=1
else n:=n div 10;
if (b=1) then write('YES')
else write('NO')
end.
program treeorfive
var b, n : integer;
begin
readln(n);
b:=0;
while (n>0) and (b=0) do
if (n mod 10=5) or (n mod 10=3)then b:=1
else if (n div 10=5) or (n div 10=3) then b:=1
else n:=n div 10;
if (b=1) then write('YES')
else write('NO')
end.