#include <iostream>
#include <cstdio>
#include <fstream>
#include <algorithm>
#include <cmath>
#include <deque>
#include <vector>
#include <queue>
#include <string>
#include <cstring>
#include <map>
#include <stack>
#include <set>
using namespace std;
int main()
{
int t;
cin >> t;
int m=3;
while(t--)
{
int n;
cin >> n;
int flag = 0;
for(int i=1; i<1001; i++)
{
if(n==(m+1)*i+1 || n==(m+1)*i+2 || n<=m || n==(m+1)*i+3)
flag = 1;
}
if(flag == 1)
printf("YES\n");
else
printf("NO\n");
}
return 0;
}
详情
https://wenku.baidu.com/view/3c0d1d9a51e79b896802267b.html