#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int i, j, k, l, n, flag = 0, num;
  string str;
  cin >> str;
  n = str.length();
  map<long long int, long long int> a;
  map<long long int, long long int> b;
  for (i = 0; i < n; i++) {
    a[(long long int)(str[i] - '0')]++;
  }
  for (i = 0; i < n && flag == 0; i++) {
    k = (long long int)(str[i] - '0');
    a[k]--;
    if (k == 8 || k == 0) {
      cout << "YES\n";
      cout << k << "\n";
      flag = 1;
      return 0;
    } else {
      for (j = 1; j <= 9; j++) {
        if (b[j] > 0) {
          num = j * 10 + k;
          if (num % 8 == 0) {
            cout << "YES\n";
            cout << num << "\n";
            flag = 1;
            return 0;
          }
        }
      }
      for (j = 1; j <= 9; j++) {
        if (b[j] > 0) {
          for (l = 1; l <= 9; l++) {
            if (a[l] > 0) {
              num = j * 100 + k * 10 + l;
              if (num % 8 == 0) {
                cout << "YES\n";
                cout << num << "\n";
                flag = 1;
                return 0;
              }
            }
          }
        }
      }
    }
    b[k]++;
  }
  if (flag == 0) {
    cout << "NO\n";
    return 0;
  }
}
