#include <bits/stdc++.h>
using namespace std;
string s, st;
void check(string& ss) {
  int i = 0, j = 0;
  for (; s[j] && ss[i]; j++) {
    if (s[j] == ss[i]) i++;
  }
  int x;
  stringstream stream(ss);
  stream >> x;
  if (i == ss.size() && x % 8 == 0) {
    cout << "YES\n" << ss;
    exit(0);
  }
}
int main() {
  cin.sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> s;
  for (char i = '0'; i <= '9'; i++) {
    st = "";
    st += i;
    check(st);
    for (char j = '0'; j <= '9'; j++) {
      st = "";
      st += i;
      st += j;
      check(st);
      for (char k = '0'; k <= '9'; k++) {
        st = "";
        st += i;
        st += j;
        st += k;
        check(st);
      }
    }
  }
  cout << "NO\n";
  return 0;
}
