#include <bits/stdc++.h>
using namespace std;

int main() {
  int a;
  cin>>a;
  if(1110<=a && a<=1119){
    cout<<"Yes"<<endl;
    }
  else if(2220<=a && a<=2229){
    cout<<"Yes"<<endl;
    }
  else if(3330<=a && a<=3339){
    cout<<"Yes"<<endl;
    }
  else if(4440<=a && a<=4449){
    cout<<"Yes"<<endl;
    }
  else if(5550<=a && a<=5559){
    cout<<"Yes"<<endl;
    }
  else if(6660<=a && a<=6669){
    cout<<"Yes"<<endl;
    }
  else if(7770<=a && a<=7779){
    cout<<"Yes"<<endl;
    }
  else if(8880<=a &&a<=8889){
    cout<<"Yes"<<endl;
    }
  else if(9990<=a && a<=9999){
    cout<<"Yes"<<endl;
    }
  else if(2111==a){
    cout<<"Yes"<<endl;
    }
  else if(3111==a){
    cout<<"Yes"<<endl;
    }
  else if(4111==a){
    cout<<"Yes"<<endl;
    }
  else if(5111==a){
    cout<<"Yes"<<endl;
    }
  else if(6111==a){
    cout<<"Yes"<<endl;
    }
  else if(7111==a){
    cout<<"Yes"<<endl;
    }
  else if(8111==a){
    cout<<"Yes"<<endl;
    }
  else if(9111==a){
    cout<<"Yes"<<endl;
    }
  else if(1222==a){
    cout<<"Yes"<<endl;
    }
  else if(3222==a){
    cout<<"Yes"<<endl;
    }
  else if(4222==a){
    cout<<"Yes"<<endl;
    }
  else if(5222==a){
    cout<<"Yes"<<endl;
    }
  else if(6222==a){
    cout<<"Yes"<<endl;
    }
  else if(7222==a){
    cout<<"Yes"<<endl;
    }
  else if(8222==a){
    cout<<"Yes"<<endl;
    }
  else if(9222==a){
    cout<<"Yes"<<endl;
    }
  else if(1333==a){
    cout<<"Yes"<<endl;
    }
  else if(2333==a){
    cout<<"Yes"<<endl;
    }
  else if(4333==a){
    cout<<"Yes"<<endl;
    }
  else if(5333==a){
    cout<<"Yes"<<endl;
    }
  else if(6333==a){
    cout<<"Yes"<<endl;
    }
  else if(7333==a){
    cout<<"Yes"<<endl;
    }
  else if(8333==a){
    cout<<"Yes"<<endl;
    }
  else if(9333==a){
    cout<<"Yes"<<endl;
    }
  else if(1444==a){
    cout<<"Yes"<<endl;
    }
  else if(2444==a){
    cout<<"Yes"<<endl;
    }
  else if(3444==a){
    cout<<"Yes"<<endl;
    }
  else if(5444==a){
    cout<<"Yes"<<endl;
    }
  else if(6444==a){
    cout<<"Yes"<<endl;
    }
  else if(7444==a){
    cout<<"Yes"<<endl;
    }
  else if(8444==a){
    cout<<"Yes"<<endl;
    }
  else if(9444==a){
    cout<<"Yes"<<endl;
    }
  else if(1555==a){
    cout<<"Yes"<<endl;
    }
  else if(2555==a){
    cout<<"Yes"<<endl;
    }
  else if(3555==a){
    cout<<"Yes"<<endl;
    }
  else if(4555==a){
    cout<<"Yes"<<endl;
    }
  else if(6555==a){
    cout<<"Yes"<<endl;
    }
  else if(7555==a){
    cout<<"Yes"<<endl;
    }
  else if(8555==a){
    cout<<"Yes"<<endl;
    }
  else if(9555==a){
    cout<<"Yes"<<endl;
    }
  else if(1666==a){
    cout<<"Yes"<<endl;
    }
  else if(2666==a){
    cout<<"Yes"<<endl;
    }
  else if(3666==a){
    cout<<"Yes"<<endl;
    }
  else if(4666==a){
    cout<<"Yes"<<endl;
    }
  else if(5666==a){
    cout<<"Yes"<<endl;
    }
  else if(7666==a){
    cout<<"Yes"<<endl;
    }
  else if(8666==a){
    cout<<"Yes"<<endl;
    }
  else if(9666==a){
    cout<<"Yes"<<endl;
    }
  else if(1777==a){
    cout<<"Yes"<<endl;
    }
  else if(2777==a){
    cout<<"Yes"<<endl;
    }
  else if(3777==a){
    cout<<"Yes"<<endl;
    }
  else if(4777==a){
    cout<<"Yes"<<endl;
    }
  else if(5777==a){
    cout<<"Yes"<<endl;
    }
  else if(6777==a){
    cout<<"Yes"<<endl;
    }
  else if(8777==a){
    cout<<"Yes"<<endl;
    }
  else if(9777==a){
    cout<<"Yes"<<endl;
    }
  else if(1888==a){
    cout<<"Yes"<<endl;
    }
  else if(2888==a){
    cout<<"Yes"<<endl;
    }
  else if(3888==a){
    cout<<"Yes"<<endl;
    }
  else if(4888==a){
    cout<<"Yes"<<endl;
    }
  else if(5888==a){
    cout<<"Yes"<<endl;
    }
  else if(6888==a){
    cout<<"Yes"<<endl;
    }
  else if(7888==a){
    cout<<"Yes"<<endl;
    }
  else if(9888==a){
    cout<<"Yes"<<endl;
    }
  else if(1999==a){
    cout<<"Yes"<<endl;
    }
  else if(2999==a){
    cout<<"Yes"<<endl;
    }
  else if(3999==a){
    cout<<"Yes"<<endl;
    }
  else if(4999==a){
    cout<<"Yes"<<endl;
    }
  else if(5999==a){
    cout<<"Yes"<<endl;
    }
  else if(6999==a){
    cout<<"Yes"<<endl;
    }
  else if(7999==a){
    cout<<"Yes"<<endl;
    }
  else if(8999==a){
    cout<<"Yes"<<endl;
    }
  else if(1000==a){
    cout<<"Yes"<<endl;
    }
  else if(2000==a){
    cout<<"Yes"<<endl;
    }
  else if(3000==a){
    cout<<"Yes"<<endl;
    }
  else if(4000==a){
    cout<<"Yes"<<endl;
    }
  else if(5000==a){
    cout<<"Yes"<<endl;
    }
  else if(6000==a){
    cout<<"Yes"<<endl;
    }
  else if(7000==a){
    cout<<"Yes"<<endl;
    }
  else if(8000==a){
    cout<<"Yes"<<endl;
    }
  else if(9000==a){
    cout<<"Yes"<<endl;
    }
  else {
    cout<<"No"<<endl;
    }
  }

Measured memory_bytes: 256