#include <bits/stdc++.h>
using namespace std;
char a[100];
int mp[] = {8, -1, -2, 3, 6, 9, 4, 7, 0, 5};
int main() {
  cin >> a;
  int len = strlen(a);
  int flag = 0;
  for (int i = 0; i < len; i++) {
    if (a[i] - 48 != mp[a[len - 1 - i] - 48]) flag = 1;
  }
  if (!flag)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
