#include <bits/stdc++.h>

using namespace std;

int main() {
    string str;
    int count = 1;
    cin >> str;
    for (auto s : str) {
        if (count%2 == 1 && isupper(s)) {
            cout << "No";
            return 0;
        }
        else if (count%2 == 0 && islower(s)) {
            cout << "No";
            return 0;
        }
        ++count;
    }

    cout << "Yes";
}
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define REP(i, k, n) for(ll i = k; i < n; ++i)
#define REPI(i, k, n) for(ll i = k; i >= n; --i)
#define vi vector<int>
#define vch vector<char>
#define vstr vector<string>
#define vll vector<ll>
#define vb vector<bool>
#define vvi vector<vi>
#define vpl vector<pair<ll, ll>>
#define vpi vector<pair<int, int>>
#define F first
#define S second
#define el "\n"
#define sz(x) x.size()
#define ld long double
#define sortar(v) sort(v.begin(),v.end())
#define rsort(v) sort(v.rbegin(),v.rend())
#define all(x) x.begin(), x.end()
#define div 1000000007
#define div2 998244353
#define pi 3.14159265358979323846
#define inf 1000000000000000000
#define blk 455
#define pb push_back
#define ppb pop_back
#define print(x) for(auto p:x) cout<<p<<' '; cout<<el;
#define N 1000005
bool isPrime[N] = {false};
vll prm;
vll SPF(N);

void sieve()
{
    isPrime[1] = isPrime[0] = 0;
    ll i;
    
    for(i=2;i<N;++i) isPrime[i] = 1;

    for(i=2;i*i<N;++i)
    {
        if(isPrime[i])
        {
            for(ll j = i*i; j<N; j += i)
                isPrime[j] = 0;
        }
    }
    
    if(!prm.empty())
        prm.clear();

    REP(i,2,N)
    {
        if(isPrime[i])
            prm.pb(i);
    }
    
}

bool flip(bool f)
{
    if(f) return 0;
    return 1;
}

ll fastPower(ll a, ll b)
{
    if(b == 0) return 1;
    ll prod = 1;
    while(b > 0)
    {
        if(b & 1)
            prod = prod * a;
        b = b >> 1;
        a = a * a;
    }
    return prod;
}

ll fact(ll n) {
    ll res = 1;
    for(ll i=2;i<=n;i++) {
        res*=i;
    }
    return res;
}

ll nCr(ll n,ll r) {
    return (ld)fact(n)/(ld)(fact(r)*fact(n-r));
}

void printa(bool f){
    if(f) cout<<"YES"<<el;
    else cout<<"NO"<<el;
}

void solve()
{
    string a;
    cin>>a;
    ll n = a.length(), i;
    REP(i,0,n){
        int v = (int)a[i];
        if(i&1){
            if(v>=65 && v <=90) continue;
            else{cout<<"No"<<el; return;}
        }
        else{
            if(v >= 97 && v <= 122) continue;
            else{cout<<"No"<<el; return;}
        }
    }
    cout<<"Yes"<<el;
}

int main()
{
    #ifndef ONLINE_JUDGE 
    freopen("C:/Users/Lenovo/Desktop/inpOut/input.txt", "r", stdin); 
    freopen("C:/Users/Lenovo/Desktop/inpOut/output.txt", "w", stdout); 
    #endif

    // ios_base::sync_with_stdio(0);
    // cin.tie(0);

    int tc = 1, i = 1;
    scanf("%d", &tc);
    while(tc--)
    {
        // cout<<"Case #"<<i<<": ";
        solve();
        // ++i;
    }
    return 0;
}