#include <bits/stdc++.h>
using namespace std;
void solve() {
  string s;
  cin >> s;
  int n = s.size();
  for (int i = 0; i < n; i++) {
    string t = string(1, s[i]);
    if (!t.empty() && stoi(t) % 8 == 0) {
      cout << "YES\n";
      cout << t;
      return;
    }
    for (int j = i + 1; j < n; j++) {
      string tt = t + s[j];
      if (!tt.empty() && stoi(tt) % 8 == 0) {
        cout << "YES\n";
        cout << tt;
        return;
      }
      for (int k = j + 1; k < n; k++) {
        string ttt = tt + s[k];
        if (!ttt.empty() && stoi(ttt) % 8 == 0) {
          cout << "YES\n";
          cout << ttt;
          return;
        }
      }
    }
  }
  cout << "NO";
}
int main() {
  std::ios_base::sync_with_stdio(false);
  solve();
  return 0;
}
