importPackage(java.io);
importPackage(java.lang);
var br = new BufferedReader( new InputStreamReader(System['in']) );
var x = Long.parseLong(br.readLine());
var mod = x % 6;
switch (mod) {
case 0:
case 1:
case 3:
System.out.println( "yes" );
break;
default:
System.out.println( "no" );
}
aW1wb3J0UGFja2FnZShqYXZhLmlvKTsKaW1wb3J0UGFja2FnZShqYXZhLmxhbmcpOwoKdmFyIGJyID0gbmV3IEJ1ZmZlcmVkUmVhZGVyKCBuZXcgSW5wdXRTdHJlYW1SZWFkZXIoU3lzdGVtWydpbiddKSApOwp2YXIgeCA9IExvbmcucGFyc2VMb25nKGJyLnJlYWRMaW5lKCkpOwoKdmFyIG1vZCA9IHggJSA2OwoKc3dpdGNoIChtb2QpIHsKCWNhc2UgMDoKCWNhc2UgMToKCWNhc2UgMzoKCQlTeXN0ZW0ub3V0LnByaW50bG4oICJ5ZXMiICk7CgkJYnJlYWs7CglkZWZhdWx0OgoJCVN5c3RlbS5vdXQucHJpbnRsbiggIm5vIiApOwp9Cg==