main(i){scanf("%n",&i);i%6?puts("No"):puts("Yes");}