#include
using namespace std;
void sunday(int n){
int sum=0;
while(n>0){
int lastdigit=n%10;
sum+=lastdigit;
n/=10;
}
if(sum%2==0){
if(sum%4==0) cout<<"Yes"<<endl;
else cout<<"No"<<endl;
}
else{
if(sum%3==0) cout<<"Yes"<<endl;
else cout<<"No"<<endl;
}
}
int main() {
int N;
cin>>N;
int a;
for(int i=0;i<N;i++){
cin>>a;
sunday(a);
}
return 0;
}