#include <bits/stdc++.h>
using namespace std;
int main() {
  char a[103];
  int n, i, j, k;
  cin >> a;
  n = strlen(a);
  int flg1 = 0, flg2 = 0, flg3 = 0;
  int x;
  for (i = 0; i < n; i++) {
    if (a[i] == '8' || a[i] == '0') {
      x = a[i] - '0';
      flg1 = 1;
      break;
    }
  }
  if (flg1 == 1) {
    cout << "YES\n";
    cout << x << endl;
  } else {
    for (i = 0; i < n; i++) {
      for (j = i + 1; j < n; j++) {
        x = (a[i] - '0') * 10 + (a[j] - '0');
        if (x % 8 == 0) {
          flg2 = 1;
          break;
        }
      }
      if (flg2) break;
    }
    if (flg2 == 1) {
      cout << "YES\n";
      cout << x << endl;
    } else {
      for (i = 0; i < n; i++) {
        for (j = i + 1; j < n; j++) {
          for (k = j + 1; k < n; k++) {
            x = (a[i] - '0') * 100 + (a[j] - '0') * 10 + (a[k] - '0');
            if (x % 8 == 0) {
              flg3 = 1;
              break;
            }
          }
          if (flg3) break;
        }
        if (flg3) break;
      }
      if (flg3 == 1) {
        cout << "YES\n";
        cout << x << endl;
      } else {
        cout << "NO\n";
      }
    }
  }
}
