#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  string s;
  cin >> s;
  n = s.length();
  vector<int> v;
  for (int i = 0; i < 125; i++) v.push_back(8 * i);
  for (int i = 0; i < 125; i++) {
    int x = v[i];
    string a;
    if (x == 0)
      a += '0';
    else {
      while (x) {
        a += '0' + x % 10;
        x /= 10;
      }
      reverse(a.begin(), a.end());
    }
    int ptr = 0, ps = a.size();
    for (int j = 0; j <= n - 1; j++) {
      if (s[j] == a[ptr]) {
        ptr++;
        if (ptr == ps) {
          cout << "YES\n";
          cout << a;
          return 0;
        }
      }
    }
  }
  cout << "NO\n";
  return 0;
}
