#include <bits/stdc++.h>
using namespace std;
int f(int a) {
  if (a / 10) return 100;
  if (a == 0) return 1;
  return 10;
}
int main() {
  string s;
  cin >> s;
  int cur = s[s.length() - 1] - '0';
  if (cur % 8 == 0) {
    cout << "YES\n";
    cout << cur;
    return 0;
  } else if (cur % 2) {
    cur = 0;
  }
  for (int i = s.length() - 2; i >= 0; --i) {
    if ((s[i] - '0') % 8 == 0) {
      cout << "YES\n";
      cout << s[i];
      return 0;
    }
    cur = ((s[i] - '0') * f(cur) + cur);
    if (cur % 8 == 0) {
      cout << "YES" << endl;
      cout << cur;
      return 0;
    }
    if (cur % 2) {
      cur = 0;
    } else if (cur % 4) {
      cur = cur % 10;
    } else if (cur % 8) {
      cur = cur % 100;
    }
  }
  cout << "NO";
}
