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