#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, s = 1, mx = 1;
  cin >> n;
  while (n--) {
    int x;
    cin >> x;
    if ((x % 7) % 3 == 0 || (x % 3) % 7 == 0 || x > 12)
      cout << "YES";
    else
      cout << "NO";
    cout << endl;
  }
}
