#include <bits/stdc++.h>
using namespace std;
string s;
bool contains(int x) {
  for (int i = s.size() - 1; i >= 0 && x > 0; --i)
    if (s[i] - '0' == x % 10) x /= 10;
  return x == 0;
}
int main() {
  cin >> s;
  for (int i = 0; i < s.size(); ++i)
    if (s[i] == '0') {
      cout << "YES\n0\n";
      return 0;
    }
  for (int i = 1; i < 1000; ++i)
    if (i % 8 == 0 && contains(i)) {
      cout << "YES\n" << i << '\n';
      return 0;
    }
  cout << "NO\n";
  return 0;
}
