#include <bits/stdc++.h>
#pragma optimize("Ofast")
using namespace std;
using ll = long long;
string s;
bool check(string a) {
  int res = 0;
  for (int i = 0; i < a.size(); ++i) res = res * 10 + (a[i] - '0');
  return res % 8;
}
int main() {
  cin >> s;
  for (int i = 0; i < s.size(); i++) {
    for (int j = i; j < s.size(); j++) {
      for (int k = j; k < s.size(); k++) {
        string ch = "";
        ch += s[i];
        if (i != j) ch += s[j];
        if (k != j) ch += s[k];
        if (!check(ch)) {
          cout << "YES\n" << ch << '\n';
          return 0;
        }
      }
    }
  }
  printf("NO\n");
  return 0;
}
