program escape;
var m,s,ss,t,tt:longint;
boo:boolean;
txt:text;
begin
assign(txt,'escape.in');
reset(txt);
readln(txt,m,s,t);
close(txt);
ss:=s;
tt:=t;
repeat
if m>=10 then
begin
tt:=tt-m div 10;
ss:=ss-(m div 10)*60;
m:=m mod 10;
end else
if ss<=17 then begin ss:=ss-17; tt:=tt-1; end else
if ss<=34 then begin ss:=ss-17; tt:=tt-1; end else
if (ss<51)and(m<6) then begin ss:=ss-17; tt:=tt-1; end else
if (ss<68)and(m<2) then begin ss:=ss-17; tt:=tt-1; end else
begin m:=m+4; tt:=tt-1; end;
until (ss<=0) or (tt=0);
assign(txt,'escape.out');
rewrite(txt);
if ss>0 then
begin
writeln(txt,'No');
writeln(txt,s-ss);
end else
begin
writeln(txt,'Yes');
writeln(txt,t-tt);
end;
close(txt);
end.