#include <bits/stdc++.h>
using namespace std;
char fz[13] = {'8', 'x', 'x', '3', '6', '9', '4', '7', '0', '5'};
char a[10010];
int main() {
  cin >> a;
  int n = strlen(a);
  for (int i = 0; i < n / 2 + 1; i++) {
    if (a[n - i - 1] != fz[a[i] - '0']) {
      cout << "No";
      return 0;
    }
  }
  cout << "YES";
  return 0;
}
