#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  char a[] = {'8', 'x', 'x', '3', '6', '9', '4', '7', '0', '5'};
  string s, v = "";
  cin >> s;
  reverse(s.begin(), s.end());
  for (int i = 0; i < s.size(); ++i) v += a[s[i] - '0'];
  reverse(s.begin(), s.end());
  for (int i = 0; i < s.size(); ++i)
    if (s[i] != v[i]) return cout << "No", 0;
  return cout << "Yes", 0;
}
