#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int x[101];
  for (int i = 0; i < 7; i++) {
    x[i] = 0;
  }
  x[3] = 1;
  x[6] = 1;
  x[7] = 1;
  for (int i = 8; i <= 100; i++) {
    if (x[i - 3] == 1 || x[i - 7] == 1) {
      x[i] = 1;
    } else {
      x[i] = 0;
    }
  }
  for (int i = 0; i < n; i++) {
    if (x[a[i]] == 1) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }
}
