#include <bits/stdc++.h>
int val = 0;
int rem = 0;
int main() {
  char s[101];
  scanf("%s", s);
  int len = strlen(s);
  int i;
  int temp;
  int flag = 0;
  int flagger = 0;
  for (i = 0; i < len; i++) {
    temp = s[i] - 48;
    if (temp % 8 == 0) {
      flag = 1;
      break;
    }
  }
  int j, k;
  if (flag == 0) {
    for (i = 0; i < len; i++) {
      temp = s[i] - 48;
      for (j = i + 1; j < len; j++) {
        if ((temp * 10 + s[j] - 48) % 8 == 0) {
          flag = 1;
          temp = temp * 10 + s[j] - 48;
          break;
        }
      }
      if (flag == 1) break;
    }
  }
  int temp1 = 0;
  if (flag == 0) {
    for (i = 0; i < len - 1; i++) {
      for (j = i + 1; j < len; j++) {
        for (k = j + 1; k < len; k++) {
          temp1 = (s[i] - 48) * 100 + (s[j] - 48) * 10 + s[k] - 48;
          if (temp1 % 8 == 0 && temp1 != 0) break;
        }
        if (temp1 % 8 == 0 && temp1 != 0) break;
      }
      if (temp1 % 8 == 0 && temp1 != 0) {
        flagger = 1;
        break;
      }
    }
  }
  if (flag == 1) {
    printf("YES\n");
    printf("%d\n", temp);
  } else {
    if (flagger == 1) {
      printf("YES\n");
      printf("%d\n", temp1);
    } else
      printf("NO\n");
  }
  return 0;
}
