#include <bits/stdc++.h>
using namespace std;
string str;
int ok = 1;
int main() {
  cin >> str;
  for (int i = 0, j = str.size() - 1; i < str.size(); i++, j--) {
    if (str[i] == '3' && str[j] != '3') ok = 0;
    if (str[i] == '1' && str[j] != '2') ok = 0;
    if (str[i] == '4' && str[j] != '6') ok = 0;
    if (str[i] == '7' && str[j] != '7') ok = 0;
    if (str[i] == '5' && str[j] != '9') ok = 0;
    if (str[i] == '8' && str[j] != '0') ok = 0;
  }
  if (ok) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
