var a:int64;begin while not eof do begin readln(a); if a mod 3=0 then writeln('yes') else writeln('no'); end;end.