#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  string second;
  cin >> second;
  second = "00" + second;
  int num = 0;
  for (int i = 0; i < second.size(); i++)
    for (int j = i + 1; j < second.size(); j++)
      for (int k = j + 1; k < second.size(); k++) {
        num = (second[i] - '0') * 100;
        num += (second[j] - '0') * 10;
        num += (second[k] - '0');
        if (num % 8 == 0) {
          cout << "YES\n" << num;
          return 0;
        }
      }
  cout << "NO";
  return 0;
}
