#include <bits/stdc++.h>
using namespace std;
int c[20];
bool comp(int i, int j) { return (i & (1 << j)); }
int main() {
  int n, l, r, x, i, j, k;
  long long ans = 0;
  string s;
  cin >> s;
  bool fnd = 0;
  n = s.length();
  for (i = 0; i < n; i++) {
    if (s[i] == '0') fnd = 1;
  }
  if (fnd) {
    cout << "YES\n0";
    return 0;
  }
  for (i = 0; i < n; i++) {
    if (s[i] == '8') fnd = 1;
  }
  if (fnd) {
    cout << "YES\n8";
    return 0;
  }
  if (n >= 3) {
    for (i = 0; i < n; i++) {
      if (s[i] == '0') continue;
      for (j = i + 1; j < n; j++) {
        for (k = j + 1; k < n; k++) {
          int val = (s[i] - '0') * 100;
          val += (s[j] - '0') * 10;
          val += s[k] - '0';
          if (val % 8 == 0) {
            cout << "YES\n" << val << endl;
            return 0;
          }
        }
      }
    }
  }
  for (i = 0; i < n; i++) {
    if (s[i] == '0') continue;
    for (j = i + 1; j < n; j++) {
      int val = (s[i] - '0') * 10;
      val += s[j] - '0';
      if (val % 8 == 0) {
        cout << "YES\n" << val << endl;
        return 0;
      }
    }
  }
  cout << "NO" << endl;
  return 0;
}
