#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, f = 0;
  cin >> n;
  while (n--) {
    cin >> a;
    if (a == 1 || a == 2 || a == 5 || a == 5 || a == 8 || a == 11 || a == 4)
      puts("NO");
    else
      puts("YES");
  }
}
