#include <bits/stdc++.h>
using namespace std;
int main() {
  char str[110];
  long long num;
  scanf("%s", str);
  int len = strlen(str);
  for (int i = 0; i < len; i++) {
    num = str[i] - '0';
    if (num % 8 == 0) {
      printf("YES\n%c", str[i]);
      return 0;
    }
    for (int j = i + 1; j < len; j++) {
      num = (str[i] - '0') * 10 + (str[j] - '0');
      if (num % 8 == 0) {
        printf("YES\n%lld", num);
        return 0;
      }
      for (int k = j + 1; k < len; k++) {
        num = (str[i] - '0') * 100 + (str[j] - '0') * 10 + str[k] - '0';
        if (num % 8 == 0) {
          printf("YES\n%lld", num);
          return 0;
        }
      }
    }
  }
  printf("NO\n");
  return 0;
}
