#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int a[s.length()];
  int ans = -1;
  int n = s.length();
  for (int i = 0; i < s.length(); i++) {
    a[i] = int(s[i]) - 48;
  }
  for (int i = 0; i < n; i++) {
    if (a[i] % 8 == 0) {
      ans = a[i];
      break;
    } else
      for (int j = i + 1; j < n; j++) {
        if ((a[i] * 10 + a[j]) % 8 == 0) {
          ans = a[i] * 10 + a[j];
          break;
        } else
          for (int k = j + 1; k < n; k++) {
            if ((100 * a[i] + 10 * a[j] + a[k]) % 8 == 0) {
              ans = 100 * a[i] + 10 * a[j] + a[k];
              break;
            }
          }
      }
  }
  if (ans != -1) {
    cout << "YES" << endl;
    cout << ans;
  } else
    cout << "NO";
  cout << endl;
}
