#include <bits/stdc++.h>
using namespace std;
long long int summ;
long long int f, s, g, u, d;
vector<bool> sieve(long long int n) {
  vector<bool> prime(n + 1, true);
  prime[0] = prime[1] = false;
  for (long long int i = 2; i <= n; ++i) {
    if (prime[i] && (i * i) <= n)
      for (long long int j = i * i; j <= n; j += i) prime[j] = false;
  }
  return prime;
}
long long int power(long long int a, long long int b,
                    long long int m = 1000000007) {
  a %= m;
  long long int res = 1;
  while (b > 0) {
    if (b & 1) res = res * a % m;
    a = a * a % m;
    b >>= 1;
  }
  return res;
}
vector<int> robin_karp(string s, string t) {
  int P = 31, S = s.size(), T = t.size();
  long long int m = 1e9 + 9;
  vector<long long int> p(max(S, T));
  p[0] = 1;
  int len = p.size();
  for (long long int i = 1; i < len; ++i) p[i] = (p[i] * P) % m;
  vector<long long int> h(T + 1, 0);
  for (int i = 0; i < T; i++) h[i + 1] = (h[i] + (t[i] - 'a' + 1) * p[i]) % m;
  long long h_s = 0;
  for (int i = 0; i < S; i++) h_s = (h_s + (s[i] - 'a' + 1) * p[i]) % m;
  vector<int> occurences;
  for (int i = 0; i + S - 1 < T; i++) {
    long long cur_h = (h[i + S] + m - h[i]) % m;
    if (cur_h == h_s * p[i] % m) occurences.push_back(i);
  }
  return occurences;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  string s;
  cin >> s;
  long long int a[s.size()];
  for (long long int i = 0; i < s.size(); ++i) {
    a[i] = s[i] - 48;
  }
  bool flag = false;
  if (s.size() >= 3) {
    for (long long int i = 0; i < s.size(); i++) {
      for (int j = i + 1; j < s.size(); j++) {
        for (int k = j + 1; k < s.size(); k++) {
          if ((a[i] * 100 + a[j] * 10 + a[k]) % 8 == 0) {
            cout << "YES" << '\n' << (a[i] * 100 + a[j] * 10 + a[k]);
            flag = true;
            break;
          } else if ((a[i] * 10 + a[j]) % 8 == 0) {
            cout << "YES" << '\n' << a[i] * 10 + a[j];
            flag = true;
            break;
          } else if ((a[i] * 10 + a[k]) % 8 == 0) {
            cout << "YES" << '\n' << a[i] * 10 + a[k];
            flag = true;
            break;
          } else if ((a[j] * 10 + a[k]) % 8 == 0) {
            cout << "YES" << '\n' << a[j] * 10 + a[k];
            flag = true;
            break;
          } else if (a[i] % 8 == 0) {
            cout << "YES" << '\n' << a[i];
            flag = true;
            break;
          } else if (a[j] % 8 == 0) {
            cout << "YES" << '\n' << a[j];
            flag = true;
            break;
          } else if (a[k] % 8 == 0) {
            cout << "YES" << '\n' << a[k];
            flag = true;
            break;
          }
        }
        if (flag) break;
      }
      if (flag) break;
    }
  } else if (s.size() < 3) {
    if (stoi(s) % 10 == 0) {
      cout << "YES" << '\n' << 0;
      flag = true;
    } else if (stoi(s) % 8 == 0) {
      cout << "YES" << '\n' << stoi(s);
      flag = true;
    }
  }
  if (!flag) cout << "NO";
  return 0;
}
