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