#include <bits/stdc++.h>
using namespace std;
int main() {
  char a[500];
  gets(a);
  int len = strlen(a);
  if (len % 2 && a[len / 2] != '3' && a[len / 2] != '7') {
    cout << "No";
    return 0;
  }
  for (int i = 0; i <= len / 2; i++) {
    int p = len - 1 - i;
    if ((a[i] == '3' && a[p] == '3') || (a[i] == '7' && a[p] == '7') ||
        (a[i] == '4' && a[p] == '6') || (a[i] == '6' && a[p] == '4') ||
        (a[i] == '5' && a[p] == '9') || (a[i] == '9' && a[p] == '5') ||
        (a[i] == '8' && a[p] == '0') || (a[i] == '0' && a[p] == '8'))
      continue;
    cout << "No";
    return 0;
  }
  cout << "Yes";
  return 0;
}
