#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;

int main(){
  ll N;
  cin >> N;
  ll M = N, cnt = 0;
  vector<ll> A(10,0);
  while(M > 0){
    A[cnt] = M % 10;
    M /= 10;
    cnt++;
  }
  ll rev = 0, cnt2 = 0;
  while(true){
    if(A[cnt2] == 0) cnt2++;
    else break;
  }
  rep(i,cnt){
    rev += A[i];
    rev *= 10;
  }
  rev /= 10;
  rev *= pow(10,cnt2);
  if(N == rev) cout << "Yes" <<endl;
  else cout << "No" << endl;
}


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

int main() {
  string S;string s="";cin>>S;
  for(int i=S.size()-1;i>=0;i--){
    
  if(S.at(i)=='6')s+="9";
    else{
  if(S.at(i)=='9')s+="6";
      else {s+=S.at(i);}}}
  cout<<s;
}
