#include <iostream> using namespace std; int main() { int x; cin >> x; if(x % 666 == 0){ cout << "yes" << endl; } else { cout << "no" << endl; } return 0; }