#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  for (int i = 0; i < s.length(); 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 < s.length(); i++) {
    string t;
    t += s[i];
    for (int j = i + 1; j < s.length(); j++) {
      t += s[j];
      int x = stoi(t);
      if (x % 8 == 0) {
        cout << "YES" << endl;
        cout << x;
        return 0;
      }
      t.pop_back();
    }
  }
  for (int i = 0; i < s.length(); i++) {
    string g;
    g += s[i];
    for (int j = i + 1; j < s.length(); j++) {
      g += s[j];
      for (int k = j + 1; k < s.length(); k++) {
        g += s[k];
        int y = stoi(g);
        if (y % 8 == 0) {
          cout << "YES" << endl;
          cout << y;
          return 0;
        }
        g.pop_back();
      }
      g.pop_back();
    }
  }
  cout << "NO";
  return 0;
}
