#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  for (int i = 0; i < (int)s.size(); i++) {
    if (s[i] == '0' or s[i] == '8') {
      cout << "YES\n" << s[i] << endl;
      return 0;
    }
  }
  for (int i = 0; i < (int)s.size(); i++) {
    for (int j = i + 1; j < (int)s.size(); j++) {
      if (((s[i] - '0') * 10 + (s[j] - '0')) % 8 == 0) {
        cout << "YES\n" << s[i] << s[j] << endl;
        return 0;
      }
    }
  }
  for (int i = 0; i < (int)s.size(); i++) {
    for (int j = i + 1; j < (int)s.size(); j++) {
      for (int k = j + 1; k < (int)s.size(); k++) {
        if (((s[i] - '0') * 100 + (s[j] - '0') * 10 + (s[k] - '0')) % 8 == 0) {
          cout << "YES\n" << s[i] << s[j] << s[k] << endl;
          return 0;
        }
      }
    }
  }
  cout << "NO" << endl;
  return 0;
}
