#include <bits/stdc++.h>
using namespace std;
string s;
int good;
int n;
void ans_me(int pos, int tkn, int num) {
  if (good) return;
  if (tkn && num % 8 == 0) {
    good = num;
    return;
  }
  if (pos == n) return;
  ans_me(pos + 1, tkn, num);
  if (tkn < 3) {
    ans_me(pos + 1, tkn + 1, num * 10 + s[pos] - 48);
  }
}
int main() {
  cin >> s;
  n = s.size();
  for (int i = 0; i < n; i++) {
    if (s[i] == '0') {
      cout << "YES\n0\n" << endl;
      return 0;
    }
  }
  ans_me(0, 0, 0);
  if (good) {
    cout << "YES\n";
    cout << good << endl;
  } else
    cout << "NO\n";
  return 0;
}
