#include <bits/stdc++.h>
using namespace std;
string s;
int braille[10] = {1, -1, -1, 2, 3, 4, 3, 5, 1, 4};
int main() {
  cin >> s;
  int l = 0, r = s.size() - 1;
  while (l <= r) {
    int x = braille[s[l] - '0'];
    int y = braille[s[r] - '0'];
    if (x != y || x == -1 || y == -1 || l == r && x != 2 && x != 5) {
      cout << "No";
      return 0;
    }
    l++;
    r--;
  }
  cout << "Yes";
}
