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