#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, in;
  scanf("%d", &t);
  for (int i = 0; i < t; ++i) {
    scanf("%d", &in);
    if (in == 1 || in == 2 || in == 4 || in == 5 || in == 8 || in == 11)
      printf("NO\n");
    else
      printf("YES\n");
  }
  return 0;
}
