#include <bits/stdc++.h>
using namespace std;
int main() {
  int v[] = {1, 0, 0, 3, 4, 5, 4, 7, 1, 5};
  string n;
  cin >> n;
  bool x = true;
  int max = n.length();
  if (v[n[0] - '0'] != 7 && max == 1) x = false;
  for (int i = 0; i < max - 1; i++) {
    if (v[n[i] - '0'] != v[n[max - (i + 1)] - '0'] || v[n[i] - '0'] == 0)
      x = false;
  }
  if (x == true) cout << "Yes";
  if (x == false) cout << "No";
}
