#include <bits/stdc++.h>
using namespace std;
string dp[1005][8];
string s;
int main() {
  ios_base::sync_with_stdio(0);
  cin >> s;
  dp[0][0] = "0";
  bool zero = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '0') zero = 1;
    for (int j = 0; j < 8; j++) {
      if (dp[i][j] != "") dp[i + 1][j] = dp[i][j];
      if (dp[i][j] != "") {
        if (dp[i][j] == "0")
          dp[i + 1][(j * 10 + s[i] - '0') % 8] = s[i];
        else
          dp[i + 1][(j * 10 + s[i] - '0') % 8] = dp[i][j] + s[i];
      }
    }
  }
  if (dp[s.size()][0] != "0" || zero)
    cout << "YES" << '\n' << dp[s.size()][0] << '\n';
  else
    cout << "NO" << '\n';
}
