#include <bits/stdc++.h>
using namespace std;
int a[10][2][3] = {0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0,
                   0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1,
                   0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0};
bool ok(string s) {
  for (int i = 0; i < s.size() / 2; ++i)
    if (s[i] != s[s.size() - i - 1]) return false;
  return true;
}
int main() {
  string s;
  cin >> s;
  bool ans = 1;
  for (int p = 0; p < 3 && ans; ++p) {
    string tmp = "";
    for (int i = 0; i < s.size(); ++i) {
      for (int l = 0; l < 2; ++l) tmp += (char)(a[s[i] - '0'][l][p] + '0');
    }
    if (!ok(tmp)) ans = 0;
  }
  cout << (ans ? "Yes" : "No") << endl;
  return 0;
}
