#include <bits/stdc++.h>
int main(void) {
  int n;
  int strips[100];
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &strips[i]);
  }
  for (int i = 0; i < n; i++) {
    if (strips[i] % 3 == 0) {
      printf("YES\n");
      continue;
    }
    if (strips[i] % 7 == 0) {
      printf("YES\n");
      continue;
    }
    if (strips[i] % 10 == 0) {
      printf("YES\n");
      continue;
    }
    if (strips[i] >= 12) {
      printf("YES\n");
      continue;
    }
    printf("NO\n");
  }
}
