#include <bits/stdc++.h>
using namespace std;
const int maxn = 110;
string s;
int main() {
  ios::sync_with_stdio(false);
  cin >> s;
  int len = s.size();
  for (int i = 0; i <= 1000; i += 8) {
    char a[10];
    sprintf(a, "%d", i);
    int L = strlen(a);
    int o = 0;
    for (int j = 0; j < len; j++) {
      if (s[j] == a[o]) o++;
      if (o == L) {
        cout << "YES" << endl;
        cout << a << endl;
        return 0;
      }
    }
  }
  cout << "NO" << endl;
  return 0;
}
