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