#include <bits/stdc++.h>
using namespace std;
const int N = 100 + 5;
int n, x, dp[N];
int main() {
  dp[2] = 1, dp[5] = 1, dp[6] = 1;
  for (int i = 7; i < 100; i++) {
    if (dp[i - 3] == 1 || dp[i - 7] == 1) dp[i] = 1;
  }
  cin >> n;
  for (int j = 0; j < n; j++) {
    cin >> x;
    if (dp[x - 1] == 1)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
}
