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