#include
using namespace std;
int main()
{
int a;
cout<<"Please enter an integer:";
cin>>a;
if(a%3==0) p>
cout<<"YES";
else
cout<<"NO";
return 0;
}