program escape;
var m, i: integer;
s, currents, t, currentt: longint;
begin
assign(input,'escape.in');
assign(output,'escape.out');
reset(input);
rewrite(output);
readln(m, s, t);
currents:=0;
currentt:=0;
i:=m div 10;
m:=m mod 10;
currents:=currents+60*i;
currentt:=currentt+i;
while (currentt<t) and (currents<s) do begin
if m>=10 then
begin M:=M-10; CurrentS:=currents+60;
end
else
if m<6 then currents:=currents+17
else m:=m+4;
currentt:=currentt+1
end;
if (s-currents)<=0 then
begin writeln('Yes');
writeln(currentt);
end
else
begin writeln('No');
writeln(currents+17);
end;
close(input);
close(output);
end.