#include <bits/stdc++.h>
using namespace std;
string x;
vector<char> v;
int dp[101][15][15][15];
bool calc(int indx, int a, int b, int c) {
  int ans = 0;
  int &res = dp[indx][a + 1][b + 1][c + 1];
  if (res != -1) return res;
  if (indx == x.size()) {
    if (a != -1 && b != -1 && c != -1) {
      int ans = 0;
      ans *= 10;
      ans += a;
      ans *= 10;
      ans += b;
      ans *= 10;
      ans += c;
      if (ans % 8 == 0) return true;
      return false;
    } else if (a != -1 && b != -1) {
      int ans = 0;
      ans *= 10;
      ans += a;
      ans *= 10;
      ans += b;
      if (ans % 8 == 0) return true;
      return false;
    } else if (a != -1) {
      int ans = 0;
      {
        ans *= 10;
        ans += a;
      }
      if (ans % 8 == 0) return true;
      return false;
    } else
      return false;
  }
  if (a == -1)
    ans = (ans || calc(indx + 1, x[indx] - '0', b, c));
  else if (b == -1)
    ans = (ans || calc(indx + 1, a, x[indx] - '0', c));
  else if (c == -1)
    ans = (ans || calc(indx + 1, a, b, x[indx] - '0'));
  ans = (ans || calc(indx + 1, a, b, c));
  return res = ans;
}
bool check = false;
void build(int indx, int a, int b, int c) {
  if (indx == x.size()) exit(0);
  if (a == -1 && calc(indx, a, b, c) == calc(indx + 1, x[indx] - '0', b, c)) {
    cout << x[indx];
    build(indx + 1, x[indx] - '0', b, c);
  } else if (a == -1 && calc(indx + 1, a, b, c))
    build(indx + 1, a, b, c);
  else if (b == -1 &&
           calc(indx, a, b, c) == calc(indx + 1, a, x[indx] - '0', c)) {
    cout << x[indx];
    build(indx + 1, a, x[indx] - '0', c);
  } else if (b == -1 && calc(indx + 1, a, b, c))
    build(indx + 1, a, b, c);
  else if (c == -1 &&
           calc(indx, a, b, c) == calc(indx + 1, a, b, x[indx] - '0')) {
    cout << x[indx];
    build(indx + 1, a, b, x[indx] - '0');
  } else if (c == -1 && calc(indx + 1, a, b, c)) {
    build(indx + 1, a, b, c);
  }
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  memset(dp, -1, sizeof dp);
  cin >> x;
  if (x.find('0') != -1) {
    cout << "YES" << endl << 0 << endl;
  } else if (calc(0, -1, -1, -1)) {
    cout << "YES" << endl;
    build(0, -1, -1, -1);
  } else {
    cout << "NO" << endl;
  }
}
