#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  string s;
  cin >> s;
  vector<string> k;
  for (int i = 0; i < 125; i++) {
    t = i * 8;
    k.push_back(to_string(t));
  }
  for (int i = 0; i < 125; i++) {
    string temp = k[i];
    int l = temp.size();
    int c = 0;
    for (int i = 0; i < s.size(); i++) {
      if (temp[c] == s[i]) {
        c++;
      }
    }
    if (c == l) {
      cout << "YES\n" << temp << "\n";
      return 0;
    }
  }
  cout << "NO\n";
  return 0;
}
