#include<bits/stdc++.h> #define endl '\n' using i64 = long long; using namespace std; signed main(){ std::ios::sync_with_stdio(false);cin.tie(0); int t;cin>>t; while(t--){ string str;cin >> str; int n = str.size(); str = " " + str; bool ok = 1; for (int i = 1; i <= n;i++) if(str[i]!='a'&&str[i]!='v') ok = 0; int last = 0; str += "a"; if(str[1]!='a'||str[n]!='a') //特判起始和末尾位置 ok = 0; for (int i = 1; i <= n;i++){ if(str[i]=='a'&&str[i+1]=='a'){ if (i - last != 3 && i - last != 5) ok = 0; else if (i - last == 3 && (str[i - 1] != 'v' || str[i - 2] != 'a')) ok = 0; else if (i - last == 5 && (str[i - 1] != 'v' || str[i - 2] != 'a' || str[i - 3] != 'v' || str[i - 4] != 'a')) ok = 0; if(!ok) break; last = i; //记录出现连续两个"a"的下标 } //cout << i << endl; } cout << (ok ? "Yes" : "No") << endl; } return 0; }