#include <bits/stdc++.h>
using namespace std;
ifstream fin("submultimi2.in");
ofstream fout("submultimi2.out");
int getNr(char ch) { return ch - '0'; }
int dp[105][10];
int main() {
  int ok = -1;
  string s;
  cin >> s;
  for (int i = 0; i < s.size(); i++) {
    int a = getNr(s[i]);
    if (a % 8 == 0) ok = a;
    for (int j = i + 1; j < s.size(); j++) {
      int b = getNr(s[j]);
      if ((a * 10 + b) % 8 == 0) ok = a * 10 + b;
      for (int k = j + 1; k < s.size(); k++) {
        int c = getNr(s[k]);
        if ((a * 100 + b * 10 + c) % 8 == 0) {
          ok = a * 100 + b * 10 + c;
        }
      }
    }
  }
  if (ok != -1) {
    cout << "YES\n";
    cout << ok;
  } else
    cout << "NO";
}
