#include <bits/stdc++.h>
using namespace std;
int braille[10][3][2] = {
    {{0, 1}, {1, 1}, {0, 0}}, {{1, 0}, {0, 0}, {0, 0}},
    {{1, 0}, {1, 0}, {0, 0}}, {{1, 1}, {0, 0}, {0, 0}},
    {{1, 1}, {0, 1}, {0, 0}}, {{1, 0}, {0, 1}, {0, 0}},
    {{1, 1}, {1, 0}, {0, 0}}, {{1, 1}, {1, 1}, {0, 0}},
    {{1, 0}, {1, 1}, {0, 0}}, {{0, 1}, {1, 0}, {0, 0}},
};
int main(int argc, char **argv) {
  ios_base::sync_with_stdio(false);
  cin.tie(0), cout.tie(0), cout.precision(15);
  vector<int> mirror(10, -1);
  mirror[3] = 3;
  mirror[4] = 6;
  mirror[5] = 9;
  mirror[6] = 4;
  mirror[7] = 7;
  mirror[8] = 0;
  mirror[9] = 5;
  mirror[0] = 8;
  int64_t N;
  cin >> N;
  vector<int> a;
  while (N > 0) {
    a.push_back(N % 10);
    N /= 10;
  }
  if (a.empty()) {
    a.push_back(0);
  }
  int n = a.size();
  for (int l = 0, r = n - 1; l <= r; l++, r--) {
    if (mirror[a[l]] != a[r]) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}
