#include <bits/stdc++.h>
using namespace std;
long long n, m;
int main() {
  scanf("%lld", &n);
  for (register long long i = 1; i <= n; i++)
    scanf("%lld", &m),
        puts(m == 1 || m == 2 || m == 4 || m == 5 || m == 8 || m == 11 ? "NO"
                                                                       : "YES");
  return 0;
}
