#include<stdio.h> char text[100002]; bool check(){ scanf("%s",text); char R=0,L=0; for(int i=0;text[i]!='\0';i++){ if((i&1)==0)L=text[i]; else R=text[i]; if(L==R)return false; } return true; } int main(){ int n; scanf("%d",&n); while(n--)printf("%s\n",check()?"Yes":"No"); }