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

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
typedef long long ll;

int main(){
  int n;
  cin >> n;
  vector<int> p(n);
  rep(i,n) cin >> p.at(i);

  int ans=0;
  vector<int> check(200005,0);

  rep(i,n){
    check.at(p.at(i))=1;
    if(ans!=p.at(i)) cout << ans << endl;
    else{
      while(check.at(ans)==1) ans++;
      cout << ans << endl;
    }
  }
}
#include "bits/stdc++.h"

#define pb push_back
#define ll long long
#define ii pair<int, int>
#define pll pair<ll, ll>
#define ld long double
#define vi vector<int>
#define vii vector<ii>
#define vvi vector<vi>
#define vs vector<string>
#define vl vector<ll>
#define vll vector<vl>
#define all(x) x.begin(), x.end()
#define nl endl
#define rev(x) reverse(all(x))
#define ull unsigned ll
#define vpl vector<pll>
using namespace std;

//ull find(ull x){
//    return (x * (x + 1)) / 2;
//}

//vector<int> findCharacters(string s){
//    vector<int> a(26);
//    for(char el : s)
//        a[el - 'a']++;
//    return a;
//}

vl read(vl a) {
    for (auto &el : a)
        cin >> el;
    return a;
}

//int req(int l, int r){
//    cout << "? " << l + 1 << " " << r + 1 << endl;
//    int val;
//    cin >> val;
//    return val;
//}

void solve() {
    string s;
    cin >> s;
    bool sw = 1;
    for(int i = 0; i < s.size(); i++){
        char el = s[i];
        if(i % 2){
            if(el < 'A' || el > 'Z'){
                sw = 0;
                break;
            }
        } else {
            if(el < 'a' || el > 'z'){
                sw = 0;
                break;
            }
        }
    }
    cout << (sw ? "Yes" : "No") << endl;
}

int main() {
//    int t;
//    cin >> t;
//    while (t--)
        solve();
}