#include <bits/stdc++.h>
using namespace std;
long long int powmod(long long int x, long long int y, long long int mod) {
  long long int ans = 1;
  while (y) {
    if (y % 2 == 1) {
      ans = (ans * x) % mod;
    }
    x = (x * x) % mod;
    y /= 2;
  }
  return ans;
}
bool sortin(const pair<long long int, long long int> &a,
            const pair<long long int, long long int> &b) {
  if (a.second < b.second) {
    return true;
  } else if (a.second == b.second && a.first < b.first) {
    return true;
  }
  return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t;
  t = 1;
  while (t--) {
    long long int a, b, c, d, m, k;
    string n;
    cin >> n;
    vector<bool> arr(2001, false);
    for (int i = 0; i <= 1000; i += 8) {
      arr[i] = true;
    }
    for (int i = 0; i < n.size(); i++) {
      string s;
      s = "";
      s += n[i];
      int num = stoi(s);
      if (arr[num] == true) {
        cout << "YES\n";
        cout << num << "\n";
        return 0;
      }
      for (int j = i + 1; j < n.size(); j++) {
        string p = s + n[j];
        num = stoi(p);
        if (arr[num] == true) {
          cout << "YES\n";
          cout << num << "\n";
          return 0;
        }
        for (int k = j + 1; k < n.size(); k++) {
          string q = p + n[k];
          int num = stoi(q);
          if (arr[num] == true) {
            cout << "YES\n";
            cout << num << "\n";
            return 0;
          }
        }
      }
    }
    cout << "NO\n";
  }
  return 0;
}
