#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const int inf = 1e9;
int main() {
  string s;
  cin >> s;
  int len = (int)s.size() - 1;
  for (auto x : s) {
    if (x == '1' || x == '2') return cout << "No" << endl, 0;
  }
  for (int i = 0; i < s.size() / 2; i++) {
    if ((s[i] == '9' && s[len - i] != '5') ||
        (s[i] == '6' && s[len - i] != '4') ||
        (s[i] == '6' && s[len - i] != '4') ||
        (s[i] == '3' && s[len - i] != '3') ||
        (s[i] == '0' && s[len - i] != '8') ||
        (s[i] == '7' && s[len - i] != '7') || s[i] == '1' || s[i] == '2')
      return cout << "No" << endl, 0;
  }
  if (s.size() % 2) {
    if (s[s.size() / 2] != '3' && s[s.size() / 2] != '7')
      return cout << "No" << endl, 0;
  }
  cout << "Yes" << endl;
  return 0;
}
