package test;
import java.math.BigDecimal;
import java.text.ParseException;
import java.util.Scanner;
public class Test {
/**
* d124: 3的倍数
*
* @param args
* @throws ParseException
*/
public static void main(String[] args) {
Scanner cin = new Scanner(System.in);
while (cin.hasNext()) {
BigDecimal start = cin.nextBigDecimal();
if (start.remainder(new BigDecimal(3)).intValue() == 0) {
System.out.println("yes");
} else {
System.out.println("no");
}
}
cin.close();
}
}