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