program cch(input,output);
const
minf=-1000000000;
var
s1,t1,m,s,t,i,j,ans:longint;
f,g:array[0..19] of longint;
begin
assign(input,'escape.in');
assign(output,'escape.out');
reset(input);
rewrite(output);
readln(m,s,t);
s1:=0; t1:=0;
while m>10 do
begin
dec(m,10); inc(s1,60); inc(t1);
if s1>=s then
begin
writeln('Yes');
write(t1); close(input); close(output);
halt;
end;
if t1=t then
begin
writeln('No');
write(s1); close(input); close(output);
halt;
end;
end;
for i:=0 to 19 do f[i]:=minf;
f[m]:=s1;
for i:=1 to t-t1 do
begin
g:=f;
for j:=0 to 19 do
begin
f[j]:=g[j]+17;
if j+10<=19 then
if f[j]<g[j+10]+60 then f[j]:=g[j+10]+60;
if j-4>=0 then
if f[j]<g[j-4] then f[j]:=g[j-4];
if f[j]>=s then
begin
writeln('Yes');
write(i+t1);
close(input); close(output);
halt;
end;
end;
end;
ans:=0;
for j:=0 to 19 do
if ans<f[j] then ans:=f[j];
writeln('No');
write(ans);
close(input);
close(output);
end.