program escape;
var
f1,f2:text;
i,t,time,m,ss,s:longint;
{.............................................................}
procedure rest;
begin
m:=m+4;
dec(t);
end;
{.............................................................}
procedure run;
begin
s:=s-17;
dec(t);
end;
{.............................................................}
procedure jump;
begin
m:=m-10;
s:=s-60;
dec(t);
end;
{.............................................................}
begin
assign(f1,'escape.in');
assign(f2,'escape.out');
reset(f1);rewrite(f2);
read(f1,m,ss,time);
s:=ss;t:=time;
repeat
if m>10 then jump
else if t>=7 then begin for i:=1 to 5 do rest;jump;jump;end
else run;
until (t<=0)or(s<=0);
if s<=0 then begin writeln(f2,'Yes');
writeln(f2,time-t);
end
else begin writeln(f2,'No');
writeln(f2,ss-s);
end;
close(f1);close(f2);
end.