#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
using ull = unsigned long long int;
int main() {
  string s;
  cin >> s;
  long int n = s.length();
  for (int i = 0; i < n; i++) {
    int a = s[i] - 48;
    if (a == 0 || a == 8) {
      cout << "YES\n" << s[i] - 48;
      return 0;
    }
    for (int j = i + 1; j < n; j++) {
      int b = s[j] - 48;
      if ((a * 10 + b) % 8 == 0) {
        cout << "YES\n" << a * 10 + b;
        return 0;
      }
      for (int k = j + 1; k < n; k++) {
        int c = s[k] - 48, d;
        d = a * 100 + b * 10 + c;
        if (d % 8 == 0) {
          cout << "YES\n" << d;
          return 0;
        }
      }
    }
  }
  cout << "NO";
  return 0;
}
