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