#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  string s, rev;
  cin >> s;
  rev = s;
  reverse(rev.begin(), rev.end());
  bool flag(true);
  for (int i(0); i < s.size() / 2 + 1 && flag; ++i) {
    if ((s[i] == '3' && rev[i] == '3') || (s[i] == '7' && rev[i] == '7') ||
        (s[i] == '4' && rev[i] == '6') || (s[i] == '6' && rev[i] == '4') ||
        (s[i] == '5' && rev[i] == '9') || (s[i] == '9' && rev[i] == '5') ||
        (s[i] == '0' && rev[i] == '8') || (s[i] == '8' && rev[i] == '0'))
      continue;
    else
      flag = false;
  }
  cout << (flag ? "Yes" : "No");
  return 0;
}
