#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    string s;
    cin >> s;
    vector<string> multiples;
    for (int i = 0; i < 125; i++) {
      multiples.push_back(to_string(i * 8));
    }
    for (auto i : multiples) {
      int c = 0;
      for (int j = 0; j < s.length(); j++) {
        if (s[j] == i[c]) {
          if (c == i.length() - 1) {
            cout << "YES" << endl;
            cout << i << endl;
            return 0;
          } else {
            c++;
          }
        }
      }
    }
    cout << "NO" << endl;
  }
  return 0;
}
