#include <bits/stdc++.h>
using namespace std;
const int opp[] = {8, 11, 11, 3, 6, 9, 4, 7, 0, 5};
int n;
char a[105];
bool check() {
  int i = 1, j = n;
  for (; i < j; ++i, --j)
    if (opp[a[i] - '0'] != a[j] - '0') return false;
  if (i == j) return a[i] == '3' || a[i] == '7';
  return true;
}
int main() {
  scanf("%s", a + 1);
  n = strlen(a + 1);
  puts(check() ? "Yes" : "No");
  return 0;
}
