#include <stdio.h>

int main()
{
	long long N;
	scanf("%lld", &N);

	if (N % 6 == 0) {
		printf("Yes");
	}
	else {
		printf("No");
	}

	return 0;
}