#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[100], n, last = 0;
  string num;
  cin >> num;
  n = num.length();
  for (int i = 0; i < n; i++) {
    a[i] = num[i] - '0';
    if (a[i] == 0) {
      cout << "YES" << endl;
      cout << 0 << endl;
      return 0;
    }
  }
  for (int i = n - 1; i >= 0; i--) {
    if (i == 0) {
      if (a[i] % 8 == 0) {
        cout << "YES" << endl;
        cout << a[i] << endl;
      } else {
        cout << "NO" << endl;
      }
      return 0;
    }
    for (int j = i - 1; j >= 0; j--) {
      if (j == 0) {
        last = a[j] * 10 + a[i];
        if (last % 8 == 0) {
          cout << "YES" << endl;
          cout << last << endl;
          return 0;
        }
        break;
      }
      last = a[j] * 10 + a[i];
      if (last % 8 == 0) {
        cout << "YES" << endl;
        cout << last << endl;
        return 0;
      }
      for (int k = j - 1; k >= 0; k--) {
        last = a[k] * 100 + a[j] * 10 + a[i];
        if (last % 8 == 0) {
          cout << "YES" << endl;
          cout << last << endl;
          return 0;
        }
      }
    }
  }
  cout << "NO" << endl;
  return 0;
}
