#include <bits/stdc++.h>
using namespace std;
int main() {
  string str;
  cin >> str;
  int i, j, k, l;
  int pk, kp;
  int flag = 0;
  if (str.size() >= 3) {
    for (i = str.size() - 1; i >= 0; i--) {
      pk = str[i] - '0';
      if (pk % 2) continue;
      if (pk % 8 == 0) {
        cout << "YES" << endl;
        cout << pk << endl;
        flag = 1;
        break;
      }
      for (j = i - 1; j >= 0; j--) {
        kp = str[j] - '0';
        kp = (kp * 10) + pk;
        if (kp % 4 != 0) continue;
        if (kp % 8 == 0) {
          cout << "YES" << endl;
          cout << kp << endl;
          flag = 1;
          break;
        }
        for (k = j - 1; k >= 0; k--) {
          int nh = str[k] - '0';
          nh = (nh * 100) + kp;
          if (nh % 8 == 0) {
            cout << "YES" << endl;
            cout << nh << endl;
            flag = 1;
            break;
          }
        }
        if (flag == 1) break;
      }
      if (flag == 1) break;
    }
    if (flag == 0) cout << "NO" << endl;
  } else if (str.size() == 2) {
    pk = str[1] - '0';
    kp = str[0] - '0';
    if (pk % 8 == 0) {
      cout << "YES" << endl;
      cout << pk << endl;
    } else if (kp % 8 == 0) {
      cout << "YES" << endl;
      cout << kp << endl;
    } else {
      kp = (kp * 10) + pk;
      if (kp % 8 == 0) {
        cout << "YES" << endl;
        cout << kp << endl;
      } else
        cout << "NO" << endl;
    }
  } else {
    pk = str[0] - '0';
    if (pk % 8 == 0) {
      cout << "YES" << endl;
      cout << pk << endl;
    } else
      cout << "NO" << endl;
  }
  return 0;
}
