program escape;
var m,s,ss,t,tt:longint;
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
dec(tt);
ss:=ss-60;
m:=m-10;
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
if (tt=1)or(tt=2)and(m<6)or(tt=3)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.