#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  s = "00" + s;
  int l = s.length();
  int fi = 0, fj = 0, i, j, k, num;
  for (i = 0; i < l; i++) {
    for (j = i + 1; j < l; j++) {
      for (k = j + 1; k < l; k++) {
        num = 100 * (s[i] - '0') + 10 * (s[j] - '0') + (s[k] - '0');
        if (num % 8 == 0) {
          fi = fj = 1;
          break;
        }
      }
      if (fj) break;
    }
    if (fi) break;
  }
  if (fi) {
    cout << "YES" << endl;
    for (int l = 2; l <= k; l++) {
      if (l < i)
        cout << s[l];
      else {
        if (l == i || l == j || l == k) cout << s[l];
      }
    }
  } else {
    cout << "NO";
  }
  return 0;
}
