#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int len = s.size(), num = -1, f = 0;
  for (int i = 0; i < len; i++) {
    num = (s[i] - '0');
    if (num % 8 == 0) {
      f = 1;
      break;
    }
  }
  if (!f) {
    for (int i = 0; i < len; i++) {
      for (int j = i + 1; j < len; j++) {
        num = 10 * (s[i] - '0') + (s[j] - '0');
        if (num % 8 == 0) {
          f = 1;
          break;
        }
      }
      if (f) break;
    }
    if (!f) {
      for (int i = 0; i < len; i++) {
        for (int j = i + 1; j < len; j++) {
          for (int t = j + 1; t < len; t++) {
            num = 100 * (s[i] - '0') + 10 * (s[j] - '0') + (s[t] - '0');
            if (num % 8 == 0) {
              f = 1;
              break;
            }
          }
          if (f) break;
        }
        if (f) break;
      }
      if (f)
        cout << "YES\n" << num;
      else
        cout << "NO";
    } else
      cout << "YES\n" << num;
  } else
    cout << "YES\n" << num;
  return 0;
}
