#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
int main() {
  string s;
  cin >> s;
  int a[1000], ans = -1;
  a[0] = 8;
  for (int i = 0; i < s.size(); i++) {
    a[i] = s[i] - '0';
  }
  for (int i = 0; i < s.size(); i++) {
    if (a[i] % 8 == 0) ans = a[i];
    for (int j = i + 1; j < s.size(); j++) {
      if ((a[i] * 10 + a[j]) % 8 == 0) ans = (a[i] * 10 + a[j]);
      for (int k = j + 1; k < s.size(); k++) {
        if ((a[i] * 100 + a[j] * 10 + a[k]) % 8 == 0)
          ans = (a[i] * 100 + a[j] * 10 + a[k]);
      }
    }
  }
  if (ans >= 0)
    cout << "YES" << endl << ans;
  else
    cout << "NO";
  return 0;
}
