#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  S = "00" + S;
  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++) {
        int x = (S[i] - '0') * 100 + (S[j] - '0') * 10 + (S[k] - '0');
        if (x % 8 == 0) {
          cout << "YES\n";
          cout << x << "\n";
          return 0;
        }
      }
    }
  }
  cout << "NO\n";
}
