#include <bits/stdc++.h>
using namespace std;
string s, ss;
int i, j, l, n, k;
int s2i(string ss) {
  int c;
  istringstream(ss) >> c;
  return c;
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  cin >> s;
  n = s.length();
  s = ' ' + s;
  for (i = 1; i <= n; ++i)
    if (s[i] == '0' || s[i] == '8') {
      cout << "YES\n" << s[i];
      return 0;
    }
  for (i = 1; i <= n - 1; ++i)
    for (j = i + 1; j <= n; ++j)
      if (s[i] != '0') {
        ss = s[i];
        ss = ss + s[j];
        k = s2i(ss);
        if (k % 8 == 0) {
          cout << "YES\n" << k;
          return 0;
        }
      }
  for (i = 1; i <= n - 2; ++i)
    for (j = i + 1; j <= n - 1; ++j)
      for (l = j + 1; l <= n; ++l)
        if (s[i] != '0') {
          ss = s[i];
          ss = ss + s[j] + s[l];
          k = s2i(ss);
          if (k % 8 == 0) {
            cout << "YES\n" << k;
            return 0;
          }
        }
  cout << "NO";
  return 0;
}
