#include <bits/stdc++.h>
using namespace std;
void solve() {
  string s;
  cin >> s;
  for (long long i = 0; i <= s.length() - 1; i++) {
    long long temp = (s[i] - '0');
    if (temp % 8 == 0) {
      cout << "YES"
           << "\n"
           << temp;
      return;
    }
    for (long long j = i + 1; j <= s.length() - 1; j++) {
      long long temp1 = temp * 10 + (s[j] - '0');
      if (temp1 % 8 == 0) {
        cout << "YES"
             << "\n"
             << temp1;
        return;
      }
      for (long long k = j + 1; k <= s.length() - 1; k++) {
        long long temp2 = temp1 * 10 + (s[k] - '0');
        if (temp2 % 8 == 0) {
          cout << "YES"
               << "\n"
               << temp2;
          return;
        }
      }
    }
  }
  cout << "NO";
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t = 1;
  for (long long i = 1; i <= t; i++) {
    solve();
  }
  return 0;
}
