#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t, n, i, j, k, m;
  t = 1;
  while (t--) {
    string s;
    cin >> ws >> s;
    string x = "", ans;
    long long flag = 0;
    if (s.length() > 0) {
      for (i = 0; i < s.length(); i++) {
        x = s[i];
        if (s[i] == '0') {
          ans = x;
          flag = 1;
          break;
        }
        if (stoi(x) % 8 == 0) {
          ans = x;
          flag = 1;
          break;
        }
        for (j = i + 1; j < s.length(); j++) {
          x += s[j];
          if (stoi(x) % 8 == 0) {
            ans = x;
            flag = 1;
            break;
          }
          for (k = j + 1; k < s.length(); k++) {
            x += s[k];
            if (stoi(x) % 8 == 0) {
              ans = x;
              flag = 1;
              break;
            }
            x.pop_back();
          }
          if (flag) break;
          x.pop_back();
        }
        if (flag) break;
      }
      if (flag) {
        cout << "YES" << endl << ans << endl;
      } else {
        cout << "NO" << endl;
      }
    }
  }
}
