#include <bits/stdc++.h>
using namespace std;
int answer[126][3];
int main() {
  std::ios::sync_with_stdio(false);
  int cnt = 8;
  for (int i = 0; i < 125; i++) {
    int pom = cnt;
    int brojac = 2;
    bool nula = 0;
    while (pom > 0) {
      answer[i][brojac] = pom % 10;
      pom /= 10;
      brojac--;
    }
    cnt += 8;
  }
  answer[123][2]++;
  string s;
  cin >> s;
  for (int i = 0; i < 124; i++) {
    int beg = 0;
    if (answer[i][0] == 0) beg = 1;
    if (answer[i][0] == 0 && answer[i][1] == 0) beg = 2;
    int brojac = beg;
    for (int j = 0; j < s.length(); j++) {
      if (s[j] - '0' == 0) {
        cout << "YES\n";
        cout << 0;
        return 0;
      }
      if (s[j] - '0' == answer[i][brojac]) {
        brojac++;
        if (brojac == 3) {
          cout << "YES\n";
          if (answer[i][0] == 0 && answer[i][1] == 0)
            cout << answer[i][2];
          else if (answer[i][0] == 0 && answer[i][1] != 0) {
            cout << answer[i][1] << answer[i][2];
          } else
            cout << answer[i][0] << answer[i][1] << answer[i][2];
          return 0;
        }
      }
    }
  }
  cout << "NO";
  return 0;
}
