3 3 1
 300 2 300
 4000 4000 1
 4000 4000 100
 4 2 3
 3 300 300
 4000 100 4000
 3 300 1
 300 300 1
 4000 1000 3000
 3 2 4000
 4 3 2
 3 2 300
 4000 3998 2
 100 200 300
 300 300 300
 3 3 3
 10 10 10
 10 4 9
 239 300 231
 4000 2 3998
 200 100 300
 4000 2000 2000
 4000 4000 4000
 10 7 5
 4000 100 3900
 3 4000 4000

12
 775907030
 63263244
 994443885
 24
 496527918
 908339579
 828107078
 775907030
 876839920
 938379934
 48
 196174631
 296557186
 316471646
 375912430
 72
 318389383
 135283173
 774612666
 686088712
 949581532
 310481606
 997463324
 130636800
 221262673
 680114446

#include <bits/stdc++.h>
using namespace std;
void chk(int x) {
  if (x % 8 == 0) {
    cout << "YES\n" << x << endl;
    exit(0);
  }
}
int main() {
  string s;
  cin >> s;
  int n = s.size();
  if (s[s.size() - 1] == '0') {
    cout << "YES" << endl;
    cout << 0 << endl;
  } else {
    sort(s.begin(), s.end());
    long long c;
    c = (int)s[0] - '0';
    if (c % 8 == 0) {
      cout << "YES" << endl;
      cout << c << endl;
      return 0;
    } else {
      for (int i = 0; i < n; i++) {
        for (int j = i + 1; j < n; j++) {
          for (int k = j + 1; k < n; k++) {
            int x = (s[i] - '0') * 100 + (s[j] - '0') * 10 + s[k] - '0';
            chk(x);
          }
          chk((s[i] - '0') * 10 + s[j] - '0');
        }
        chk(s[i] - '0');
      }
      cout << "NO" << endl;
    }
  }
  return 0;
}
