#include <bits/stdc++.h>
using namespace std;
string s;
bool ok = 0;
int f(int i, int j, int k) {
  int num = 100 * s[i] + 10 * s[j] + s[k] - 111 * '0';
  ok |= (num % 8 == 0);
  return num;
}
int main() {
  cin >> s;
  s = "00" + s;
  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++) {
        int num = f(i, j, k);
        if (ok) {
          cout << "YES\n" << num << '\n';
          return 0;
        }
      }
    }
  }
  cout << "NO\n";
  return 0;
}
