#include <bits/stdc++.h>
using namespace std;
inline int in() {
  int x;
  cin >> x;
  return x;
}
int main() {
  string s;
  cin >> s;
  int a[s.length()];
  for (int i = 0; i < s.length(); i++) {
    a[i] = s[i] - 48;
    if (a[i] % 8 == 0) {
      cout << "YES\n";
      cout << a[i];
      return 0;
    }
  }
  long long int n = s.length() * (s.length() - 1);
  int b[n / 2];
  int t = 0;
  for (int i = 0; i < (int)(s.length() - 1); i++) {
    for (int j = i + 1; j < s.length(); j++) {
      b[t] = (s[i] - 48) * 10 + a[j];
      if (b[t] % 8 == 0) {
        cout << "YES\n";
        cout << b[t];
        return 0;
      }
      t++;
    }
  }
  long long int temp = s.length() - 1;
  long long int temp1 = s.length() - 1;
  int c;
  for (int i = 0; i < (int)(s.length() - 2); i++) {
    for (unsigned long long int j = temp; j < (n / 2); j++) {
      c = ((s[i] - 48) * 100) + b[j];
      if (c % 8 == 0) {
        cout << "YES\n";
        cout << c;
        return 0;
      }
    }
    temp = temp + temp1 - 1;
    temp1--;
  }
  cout << "NO";
}
