#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int n = s.size();
  for (int i = 0; i < n; i++) {
    if (s[i] == '1' || s[i] == '2') {
      cout << "No";
      return 0;
    }
    if (s[i] == '3' && s[n - i - 1] != '3') {
      cout << "No";
      return 0;
    }
    if (s[i] == '4' && s[n - i - 1] != '6') {
      cout << "No";
      return 0;
    }
    if (s[i] == '6' && s[n - i - 1] != '4') {
      cout << "No";
      return 0;
    }
    if (s[i] == '5' && s[n - i - 1] != '9') {
      cout << "No";
      return 0;
    }
    if (s[i] == '0' && s[n - i - 1] != '8') {
      cout << "No";
      return 0;
    }
    if (s[i] == '9' && s[n - i - 1] != '5') {
      cout << "No";
      return 0;
    }
    if (s[i] == '8' && s[n - i - 1] != '0') {
      cout << "No";
      return 0;
    }
  }
  cout << "Yes";
  return 0;
}
