#include <bits/stdc++.h>
using namespace std;
bool isSubsequence(string s, string t) {
  int n = s.size();
  int m = t.size();
  int i, j = 0;
  for (i = 0; i < n; i++) {
    if (j < m && s[i] == t[j]) j++;
  }
  return (j == m);
}
int main() {
  string s;
  cin >> s;
  vector<string> factors;
  int n = s.size();
  for (int i = 0; i <= 1000; i += 8) {
    factors.push_back(to_string(i));
  }
  for (auto str : factors) {
    if (isSubsequence(s, str)) {
      cout << "YES\n";
      cout << str << '\n';
      return 0;
    }
  }
  cout << "NO\n";
}
