#include <bits/stdc++.h>
using namespace std;

int main() {
  string S;
  cin >> S;
  int N = S.size();
  char* cstr = new char[N];

  strcpy(cstr, S.c_str());

  bool f = true;
  for(int i = 0; i < N; ++ i){
    if((i + 1) % 2 == 1){ // 奇数
      if(+cstr[i] < 91){
        f = false;
        break;
      }
    }else{ // 偶数
      if(+cstr[i] > 96){
        f = false;
        break;
      }
    }
  }

  if(f){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
 
}

#include<iostream>
#include <cstring>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
using ll = long long;
typedef pair<int,int> pint;
typedef pair<ll,int> pli;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;

 

int main(){
  bool check[202020] = {}; int n; cin >> n;
  int now = 0;
  rep(i, n){
    int x; cin >> x; check[x] = true;
    if(!check[now]){
      cout << now << endl; continue;
    }
    else{
      while(check[now]){
        now++;
      }
    }
    cout << now << endl;
  }  
}