var a,b,c,d:integer;
beginread(d);a:=d div 100;b:= (d div 10) mod 10 ;c:=d mod 10;
if (a+b+c) >15 thenwriteln('YES')elsewriteln('NO');readln;
end.