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