#include <bits/stdc++.h>
using namespace std;
void solve() {
  string s;
  cin >> s;
  vector<string> x;
  for (long long i = 0; i < 1001; i++) {
    if (i % 8 == 0) x.push_back(to_string(i));
  }
  for (auto i : x) {
    char c = i[0];
    long long pos = 0;
    for (auto j : s) {
      if (c == j) {
        pos++;
        if (pos < i.size())
          c = i[pos];
        else {
          cout << "YES\n" << i;
          return;
        }
      }
    }
  }
  cout << "NO\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  solve();
}
