#include <bits/stdc++.h>
using namespace std;
const int INF = 0x7fffffff;
const int MOD = 1e9 + 7;
const int N = 1e6 + 10;
char s[105];
int main() {
  scanf("%s", s);
  int n = strlen(s);
  for (int i = -2; i < n - 2; i++) {
    int x = i < 0 ? 0 : s[i] - '0';
    for (int j = i + 1; j < n - 1; j++) {
      int y = j < 0 ? 0 : s[j] - '0';
      for (int k = j + 1; k < n; k++) {
        int z = s[k] - '0';
        int sum = x * 100 + y * 10 + z;
        if (sum % 8 == 0) {
          puts("YES");
          printf("%d\n", sum);
          return 0;
        }
      }
    }
  }
  puts("NO");
  return 0;
}
