#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  map<char, char> c;
  c['3'] = '3';
  c['7'] = '7';
  c['4'] = '6';
  c['6'] = '4';
  c['5'] = '9';
  c['9'] = '5';
  c['8'] = '0';
  c['0'] = '8';
  c['1'] = 'Z';
  c['2'] = 'Z';
  string s;
  cin >> s;
  int n = s.length(), i, j, k;
  bool valid = true;
  for (i = 0; i < n; i++) {
    if (c[s[i]] != s[n - 1 - i]) valid = false;
  }
  if (valid)
    cout << "Yes\n";
  else
    cout << "No\n";
  return 0;
}
