#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
const int MOD = 1000000007;
void solve() {
  string s, t = "";
  bool ok = false;
  cin >> s;
  int n = s.size();
  for (int i = 0; i < 1000; i += 8) {
    t = to_string(i);
    int x = t.size(), c = 0;
    for (int i = 0; i < n; i++) {
      if (s[i] == t[c]) c++;
      if (c == x) {
        ok = true;
        break;
      }
    }
    if (ok) {
      cout << "YES\n" << t;
      return;
    }
  }
  cout << "NO";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
