#include
using namespace std;
int main() {
int n,r,esum=0,osum=0;
long cn;
cin>>n;
while(n>0)
{ cin>>cn;
while(cn>0)
{
r=cn%10;
if(r%2==0)
{
esum=esum+r;
}
else
{
osum=osum+r;
}
cn=cn/10;
}
if((esum%4==0)||(osum%3==0))
{
cout<<"Yes"<<endl;
}
else
{
cout<<"No"<<endl;
}
n–;
}
return 0;
}