#include <bits/stdc++.h>
using namespace std;
int MOD = 1e9 + 7;
long long INF = 1e18;
int a, b, c, d;
string s;
int solve() {
  cin >> s;
  int n = s.size();
  if (n & 1) {
    if (s[n >> 1] != '3' && s[n >> 1] != '7') {
      cout << "No" << endl;
      return 0;
    }
  }
  for (int i = 0; i * 2 < n; i++) {
    if (s[i] == '4' && s[n - i - 1] != '6') {
      cout << "No" << endl;
      return 0;
    }
    if (s[i] == '5' && s[n - i - 1] != '9') {
      cout << "No" << endl;
      return 0;
    }
    if (s[i] == '8' && s[n - i - 1] != '0') {
      cout << "No" << endl;
      return 0;
    }
    if (s[i] == '6' && s[n - i - 1] != '4') {
      cout << "No" << endl;
      return 0;
    }
    if (s[i] == '9' && s[n - i - 1] != '5') {
      cout << "No" << endl;
      return 0;
    }
    if (s[i] == '0' && s[n - i - 1] != '8') {
      cout << "No" << endl;
      return 0;
    }
    if (s[i] == '3' && s[n - i - 1] != '3') {
      cout << "No" << endl;
      return 0;
    }
    if (s[i] == '7' && s[n - i - 1] != '7') {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}
int main() {
  ios::sync_with_stdio(0);
  solve();
  return 0;
}
