#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e05 + 7;
int v[MAXN];
long long int n;
int main() {
  string tmp;
  cin >> tmp;
  if (tmp.length() & 1 != 0)
    if ((tmp[tmp.length() / 2] != '3') && (tmp[tmp.length() / 2] != '7')) {
      cout << "No" << endl;
      return 0;
    } else
      tmp.erase(tmp.begin() + tmp.length() / 2);
  bool judge = true;
  for (int i = 0; i < tmp.length() / 2; i++) {
    int j = tmp.length() - i - 1;
    if ((tmp[i] == '1' && tmp[j] != '1') || (tmp[i] == '2' && tmp[j] != '2') ||
        (tmp[i] == '3' && tmp[j] != '3') || (tmp[i] == '4' && tmp[j] != '6') ||
        (tmp[i] == '5' && tmp[j] != '9') || (tmp[i] == '6' && tmp[j] != '4') ||
        (tmp[i] == '7' && tmp[j] != '7') || (tmp[i] == '9' && tmp[j] != '5') ||
        (tmp[i] == '8' && tmp[j] != '0') || (tmp[i] == '0' && tmp[j] != '8')) {
      judge = false;
      break;
    }
  }
  if (judge)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
