#include
using namespace std;
int main() {
int n,no ;
cin>>no;
for(int i=1;i<=no;i++){
cin>>n;
}
int sumeven=0;
int sumodd=0;
int rem;
for(int i=1;i<=no;i++){
while(n!=0){
rem=rem+n%10;
n=n/10;
if(rem%2==0){
sumeven+=rem;}
else{
sumodd+=rem;
}
}
if(sumeven%4==0||sumodd%3==0){
cout<<"Yes";
cout<<endl;
}
else {
cout<<"No";
cout<<endl;
}
}
return 0;
}