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