#include <bits/stdc++.h>
using namespace std;
void solve() {
  string s, b;
  cin >> s;
  int n = s.length();
  for (int i = 0; i < n; i++) {
    int a = 0;
    a = s[i] - '0';
    if (a % 8 == 0) {
      cout << "YES\n" << a;
      return;
    }
    a *= 10;
    for (int j = i + 1; j < n; j++) {
      int b = a + (s[j] - '0');
      if (b % 8 == 0) {
        cout << "YES\n" << b;
        return;
      }
      b *= 10;
      for (int k = j + 1; k < n; k++) {
        int c = b + (s[k] - '0');
        if (c % 8 == 0) {
          cout << "YES\n" << c;
          return;
        }
      }
    }
  }
  cout << "NO";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
