#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') {
      f = -1;
    }
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = (x << 1) + (x << 3) + (ch ^ 48);
    ch = getchar();
  }
  return x * f;
}
int chart[10] = {8, -1, -1, 3, 6, 9, 4, 7, 0, 5};
char c[15];
int main() {
  scanf("%s", c);
  int len = strlen(c);
  int ter = len / 2 + 1;
  for (int i = 0; i < ter; i++) {
    if (len % 2 == 0 && (c[i] == '1' || c[i] == '2')) {
      cout << "No";
      return 0;
    }
    if (int(chart[c[i] - '0']) != c[len - i - 1] - '0') {
      cout << "No";
      return 0;
    }
  }
  cout << "Yes";
  return 0;
}
