#include <bits/stdc++.h>

class kin{
public:
	inline void open(FILE *,int);
	inline void close(void);
	inline void scan(void);
	inline kin &operator>(char &);
	inline kin &operator>(int &);
	inline kin &operator>(long long &);
	inline kin &operator>(double &);
	inline kin &operator>(long double &);
	inline kin &operator>(char *);
	template<class T>
	inline void get(T *,int);
private:
	FILE *fp;
	char *buf;
	int siz;
	int idx;
}in;

class kout{
public:
	inline void open(FILE *,int);
	inline void close(void);
	inline void print(void);
	inline kout &operator<(char);
	inline kout &operator<(int);
	inline kout &operator<(long long);
	inline kout &operator<(double);
	inline kout &operator<(long double);
	inline kout &operator<(const char *);
	template<class T>
	inline void put(T *,int,char,char);
private:
	FILE *fp;
	char *buf;
	int siz;
	int idx;
}out;

int main(int argc,char **argv){
	in.open(stdin,512);
	out.open(stdout,512);
	in.scan();
	int n;
	in>n;
	int p;
	in>p;
	int f=1;
	for(int i=1;i<n;++i){
		int h;
		in>h;
		if(h<p){
			f=0;
			break;
		}
		if(h>p) p=h-1;
	}
	out<(f?"Yes":"No")<'\n';
	out.print();
	in.close();
	out.close();
	return 0;
}

inline void kin::open(FILE *fparg,int sizarg){
	fp=fparg;
	buf=new char[sizarg];
	siz=sizarg;
	idx=0;
	return;
}
inline void kin::close(void){
	fp=nullptr;
	delete[] buf;
	buf=nullptr;
	siz=0;
	idx=0;
	return;
}
inline void kin::scan(void){
	int readsiz=(int)std::fread((void *)buf,(std::size_t)1,(std::size_t)siz,fp);
	if(readsiz!=siz) buf[readsiz]='\x00';
	idx=0;
	return;
}
inline kin &kin::operator>(char &var){
	if(!buf[idx]){
		var='\x00';
		return *this;
	}
	var=buf[idx];
	if(++idx==siz) scan();
	if(++idx==siz) scan();
	return *this;
}
inline kin &kin::operator>(int &var){
	if(!buf[idx]){
		var=0;
		return *this;
	}
	int sign=-1;
	if(buf[idx]=='-'){
		sign=1;
		if(++idx==siz) scan();
	}
	var=0;
	while(buf[idx]>='0'){
		var=var*10-(int)(buf[idx]-'0');
		if(++idx==siz) scan();
	}
	var*=sign;
	if(++idx==siz) scan();
	return *this;
}
inline kin &kin::operator>(long long &var){
	if(!buf[idx]){
		var=0LL;
		return *this;
	}
	long long sign=-1LL;
	if(buf[idx]=='-'){
		sign=1LL;
		if(++idx==siz) scan();
	};
	var=0LL;
	while(buf[idx]>='0'){
		var=var*10LL-(long long)(buf[idx]-'0');
		if(++idx==siz) scan();
	}
	var*=sign;
	if(++idx==siz) scan();
	return *this;
}
inline kin &kin::operator>(double &var){
	if(!buf[idx]){
		var=0.0;
		return *this;
	}
	double sign=-1.0;
	if(buf[idx]=='-'){
		sign=1.0;
		if(++idx==siz) scan();
	}
	var=0.0;
	while(buf[idx]>='0'){
		var=var*10.0-(double)(buf[idx]-'0');
		if(++idx==siz) scan();
	}
	if(buf[idx]=='.'){
		if(++idx==siz) scan();
		double dig=1.0;
		while(buf[idx]>='0'){
			var-=(double)(buf[idx]-'0')*(dig/=10.0);
			if(++idx==siz) scan();
		}
	}
	var*=sign;
	if(++idx==siz) scan();
	return *this;
}
inline kin &kin::operator>(long double &var){
	if(!buf[idx]){
		var=0.0L;
		return *this;
	}
	long double sign=-1.0L;
	if(buf[idx]=='-'){
		sign=1.0L;
		if(++idx==siz) scan();
	}
	var=0.0L;
	while(buf[idx]>='0'){
		var=var*10.0L-(long double)(buf[idx]-'0');
		if(++idx==siz) scan();
	}
	if(buf[idx]=='.'){
		if(++idx==siz) scan();
		long double dig=1.0L;
		while(buf[idx]>='0'){
			var-=(long double)(buf[idx]-'0')*(dig/=10.0L);
			if(++idx==siz) scan();
		}
	}
	var*=sign;
	if(++idx==siz) scan();
	return *this;
}
inline kin &kin::operator>(char *str){
	if(!buf[idx]){
		str[0]='\x00';
		return *this;
	}
	int ptr=0;
	while(buf[idx]>='!'){
		str[ptr++]=buf[idx];
		if(++idx==siz) scan();
	}
	str[ptr]='\x00';
	if(++idx==siz) scan();
	return *this;
}
template<class T>
inline void kin::get(T *arr,int num){
	for(int i=0;i<num;++i) (*this)>arr[i];
	return;
}

inline void kout::open(FILE *fparg,int sizarg){
	fp=fparg;
	buf=new char[sizarg];
	siz=sizarg;
	idx=0;
	return;
}
inline void kout::close(void){
	fp=nullptr;
	delete[] buf;
	buf=nullptr;
	siz=0;
	idx=0;
	return;
}
inline void kout::print(void){
	std::fwrite((void *)buf,(std::size_t)1,(std::size_t)idx,fp);
	idx=0;
	return;
}
inline kout &kout::operator<(char val){
	buf[idx]=val;
	if(++idx==siz) print();
	return *this;
}
inline kout &kout::operator<(int val){
	if(val<0){
		buf[idx]='-';
		if(++idx==siz) print();
	}
	else val*=-1;
	char dig[10];
	int ptr=0;
	do{
		int tmp=val/10;
		dig[ptr++]=(char)-(val-tmp*10)+'0';
		val=tmp;
	}while(val);
	while(ptr--){
		buf[idx]=dig[ptr];
		if(++idx==siz) print();
	}
	return *this;
}
inline kout &kout::operator<(long long val){
	if(val<0LL){
		buf[idx]='-';
		if(++idx==siz) print();
	}
	else val*=-1LL;
	char dig[19];
	int ptr=0;
	do{
		long long tmp=val/10LL;
		dig[ptr++]=(char)-(val-tmp*10LL)+'0';
		val=tmp;
	}while(val);
	while(ptr--){
		buf[idx]=dig[ptr];
		if(++idx==siz) print();
	}
	return *this;
}
inline kout &kout::operator<(double val){
	if(val<0.0){
		buf[idx]='-';
		if(++idx==siz) print();
	}
	else val*=-1.0;
	double dig=1.0;
	while(val/dig<=-10.0) dig*=10.0;
	int tmp;
	while(dig>=1.0){
		buf[idx]=(char)-(tmp=(int)(val/dig))+'0';
		if(++idx==siz) print();
		val-=(double)tmp*dig;
		dig/=10.0;
	}
	buf[idx]='.';
	if(++idx==siz) print();
	for(int i=0;i<12;++i){
		buf[idx]=(char)-(tmp=(int)(val/dig))+'0';
		if(++idx==siz) print();
		val-=(double)tmp*dig;
		dig/=10.0;
	}
	return *this;
}
inline kout &kout::operator<(long double val){
	if(val<0.0L){
		buf[idx]='-';
		if(++idx==siz) print();
	}
	else val*=-1.0L;
	long double dig=1.0L;
	while(val/dig<=-10.0L) dig*=10.0L;
	int tmp;
	while(dig>=1.0L){
		buf[idx]=(char)-(tmp=(int)(val/dig))+'0';
		if(++idx==siz) print();
		val-=(long double)tmp*dig;
		dig/=10.0L;
	}
	buf[idx]='.';
	if(++idx==siz) print();
	for(int i=0;i<16;++i){
		buf[idx]=(char)-(tmp=(int)(val/dig))+'0';
		if(++idx==siz) print();
		val-=(long double)tmp*dig;
		dig/=10.0L;
	}
	return *this;
}
inline kout &kout::operator<(const char *str){
	for(int i=0;str[i];++i){
		buf[idx]=str[i];
		if(++idx==siz) print();
	}
	return *this;
}
template<class T>
inline void kout::put(T *arr,int num,char dlm,char end){
	--num;
	for(int i=0;i<num;++i) (*this)<arr[i]<dlm;
	(*this)<arr[num]<end;
	return;
}


#define DEBUG 0
#include <bits/stdc++.h>
#define all(v) (v).begin(), (v).end()
#define pb push_back
#define REP(i,n) for(int i=0; i<(n); i++)
#define REP2(i,x,n) for(int i=x; i<(n); i++)
using namespace std;
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
template<class T>using numr=std::numeric_limits<T>;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
const int INF = 1e9;
const ll LLINF = 1e16;
const int mod = 1000000007;
const int mod2 = 998244353;
void debug_impl() { std::cerr << std::endl; }
template <typename Head, typename... Tail>
void debug_impl(Head head, Tail... tail) { std::cerr << " " << head; debug_impl(tail...); }
#if DEBUG
#define debug(...)\
    do {\
        std::cerr << std::boolalpha << "[" << #__VA_ARGS__ << "]:";\
        debug_impl(__VA_ARGS__);\
        std::cerr << std::noboolalpha;\
    } while (false)
#else
#define debug(...) {}
#endif

template < typename Container, typename Value = typename Container::value_type, std::enable_if_t<!std::is_same< Container, std::string >::value, std::nullptr_t> = nullptr>
std::istream& operator>> (std::istream& is, Container& v)
    { for (auto & x : v) { is >> x; } return is; }

template < typename Container, typename Value = typename Container::value_type, std::enable_if_t<!std::is_same< Container, std::string >::value, std::nullptr_t> = nullptr >
std::ostream& operator<< (std::ostream& os, Container const& v) {
os << "{";
    for (auto it = v.begin(); it != v.end(); it++)
        {os << (it != v.begin() ? "," : "") << *it;}
    return os << "}";
}

int main() {
    std::cin.tie(nullptr);
    std::ios::sync_with_stdio(false);
    int n;
    cin >> n;
    vector<int> h(n);
    cin >> h;
    bool ok = true;
    int now = h[n-1];
    for(int i = n-1;i>0;i--){
        if(now>=h[i-1]-1){
            now = max(now,h[i-1]-1);
        }
        else{
            ok = false;
        }

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


#include <bits/stdc++.h>
using namespace std;
int main()
{
	long long int n;
	cin>>n;
	long long int i,h[n];
	for(i=0;i<n;i++)
	{
		cin>>h[i];
	}
	for(i=1;i<n;i++)
	{
		if(h[i]-h[i-1]<-1)
		{
			cout<<"No"<<endl;
			return 0;
		}
		if(h[i]<h[i-1] && h[i]>h[i+1])
		{
		 if(i+1<=n-1)
		 {
			cout<<"No"<<endl;
			return 0;
		 }
		}
	}
	cout<<"Yes"<<endl;
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
	long long int n;
	cin>>n;
	long long int i,h[n];
	for(i=0;i<n;i++)
	{
		cin>>h[i];
	}
	for(i=1;i<n;i++)
	{
		if(h[i]-h[i-1]<-1)
		{
			cout<<"No"<<endl;
			return 0;
		}
		if(h[i]<h[i-1] && h[i]>h[i+1])
		{
		 if(i+1<=n-1)
			cout<<"No"<<endl;
			return 0;
		}
	}
	cout<<"Yes"<<endl;
}


// AtCoder ABC136: C - Build Stairs
// 2019.8.26 bal4u

#include <stdio.h>

//// 高速入力
#define gc() getchar_unlocked()

int in() {   // 非負整数の入力
	int n = 0, c = gc();
	do n = 10 * n + (c & 0xf); while ((c = gc()) >= '0');
	return n;
}

int main()
{
	int h, ph, N;

	ph = 0;
	N = in(); while (N--) {
		h = in();
		if (ph < h) h--;
		if (ph > h) { puts("No"); return 0; }
		ph = h;
	}
	puts("Yes");
	return 0;
}


#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(void){
  int N,i;
  long h[100005];
  char str[2000000],*p;

  fgets(str,sizeof(str),stdin);
  N=atoi(str);

  fgets(str,sizeof(str),stdin);
  p=strtok(str," \n");
  h[0]=atol(p);

  for(i=1;i<N;i++){
    p=strtok(NULL," \n");
  	h[i]=atol(p);
  }

  h[0]-=1;

  for(i=1;i<N;i++){
    if(h[i-1]>h[i]){
      printf("No\n");
      return 0;
    }
    if(h[i-1]<h[i]){
      h[i]-=1;
    }
  }

  printf("Yes\n");

  return 0;
}


#include<stdio.h>

int main(){
    int n;
    int i;
    int num;
    char *tmp = NULL;
    int max=0,min=0;
    char ch;

    while(~scanf("%d",&n)){
        getchar();
        int no = 0;
        num = 0;
        max = min = 0;
        while((ch = getchar())){
            if(ch == ' '||ch == '\n'){
                if(num > max){
                    max = min = num;
                }else if(num < min){
                    min = num;
                }

                if(max - min > 1){
                    no = 1;
                }
                num = 0;
                if(ch == '\n') break;
            }else{
                num=num*10+ (ch - '0');
            }
        }

        printf("%s\n",no?"No":"Yes");
    }
    return 0;
}


#include <stdio.h>

int main(void){
  int n,a[100005],i;
  scanf("%d",&n);
  for(i=1;i<=n;i++){
    scanf("%d",&a[i]);
  }
  for(i=n-1;i>=1;i--){
    if(a[i]<a[i-1]){a[i-1]--;
    printf("No");return 0;}
  }
  i=n-2;
  if(a[i]<a[i-1]){ printf("No");return 0;}

  printf("Yes\n");

  return 0;
}


#include <stdio.h>

int main(void){
  int n,a[100005],i;
  scanf("%d",&n);
  for(i=1;i<=n;i++){
    scanf("%d",&a[i]);
  }
  for(i=n-1;i>=1;i--){
    if(a[i]<a[i-1])a[i-1]--;
    if(a[i]<a[i-1]){printf("No");return 0;}
  }
  printf("Yes\n");

  return 0;
}


#include <stdio.h>

int main(void){
  int n,h[100005],i;
  scanf("%d",&n);
  for(i=1;i<=n;i++){
    scanf("%d",&h[i]);
  }
  for(i=1;i<=n-2;i++){
    if((i==n-2)&&(h[i]-h[i+1]>=2)){
      printf("No\n");
      return 0;
        }else{
    if((h[i]-h[i+1]>=2)&&(h[i]<=h[i+2])){
    printf("No\n");
      return 0;

    }else if(h[i]-h[i+1]==1){
    h[i]--;
    }
    }

  printf("Yes\n");

  return 0;
  }
}


function f(inp) {
    inp = inp.split("\n");
    var N = +inp[0];
    for (var i = 0, H = inp[1].split(" "); i < H.length;) {
        H[i] = +H[i++];
    }
    var lf = H[0];
    for (var i = 1; i < N; i++) {
        if (lf < H[i]) {
            H[i]--;
        }
        else if (lf > H[i]) {
            console.log("No");
            return;
        }
        lf = H[i];
    }
    console.log("Yes");
}
f(require("fs").readFileSync("/dev/stdin", "utf8"));


function Main(input) {
  var len = parseInt(input.split("\n")[0]);
  var list = input.split("\n")[1].split(" ");
  if(len == 1){
     console.log("Yes");
    return;
  }else{
      for(var i = 0; i < list.length - 1; i++){
        var tmp1 = parseInt(list[i]);
        var tmp2 = parseInt(list[i + 1]);
        var tmp3 = tmp2 - 1;
        //console.log(tmp1 + "," + tmp2 + "," + tmp3);
        if(tmp1 <= tmp2 || tmp1 <= tmp3){
           if(tmp1 <= tmp3){
              list[i + 1] = tmp3;
           }
        }else{
           console.log("No");
        return;
        }
      }
    console.log("Yes");
  }
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));


// inputに入力データ全体が入る
function Main(input) {
    // 1行目がinput[0], 2行目がinput[1], …に入る
    input = input.split("\n");
    // tmp0 = input[0].split(" ");
    tmp1 = input[1].split(" ");
    N = Number(input[0])
    H = []
    for(var i=0; i < N; i++)
    {
      H.push(Number(tmp1[i]))
    }

    beforeH = H[0]

    for(var i=1; i < N; i++)
    {
      if(beforeH < H[i])
      {
        H[i]--
      }
      else if(beforeH > H[i])
      {
        console.log("No")
        return;
      }
      beforeH = H[i]
    }
    console.log("Yes")
}
  //*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
// Main("5\n1 2 1 1 3\n");


function f(inp) {
    inp = inp.split("\n");
    var N = +inp[0];
    var H = inp[1].split(" ").map(s => +s);
    var lf = H[0];
    for (var i = 1; i < N; i++) {
        var x = H[i];
        if (lf < x) {
            H[i]--;
        }
        else if (lf > x) {
            console.log("No")
            return;
        }
        lf = x;
    }
    console.log("Yes")
}
f(require("fs").readFileSync("/dev/stdin", "utf8"));


function Main(input) {
  input = input.split("\n");
  var N = parseInt(input[0]);
  var H = input[1].split(" ").map(i => parseInt(i));
  var H1=0;
  var ans="Yes";
  var max=0;
  for(var i=1;i<N;i++){
    if(H[i-1]-H[i]>2){
      ans="No";
      break;
    }else if(H[i-1]-H[i]==1){
      if(H[i-1]-1>=max){
        max=H[i-1]-1;
      }else{
        ans="No";
        break;
      }
    }
  }

  console.log('%s', ans);
  return ans;
}

function debug(n){
  var input = document.getElementById("input"+n).value;
  var ans=Main(input);
  var result="WA";
  if(ans==document.getElementById("output"+n).value.split("\n")[0]){
    result="AC";
  }
  document.getElementById("result"+n).innerHTML=result;
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


<!DOCTYPE html>

Input1:

<textarea id="input1" rows="5" cols="80">4
1 3 2 1

</textarea>

<input type="button" value="実行する" onClick="debug(1);">

<textarea id="output1">No</textarea>

Input2:

<textarea id="input2" rows="5" cols="80">5
1 2 3 4 5

</textarea>

<input type="button" value="実行する" onClick="debug(2);">

<textarea id="output2">Yes</textarea>

Input3:

<textarea id="input3" rows="5" cols="80">5
1 2 1 1 3

</textarea>

<input type="button" value="実行する" onClick="debug(3);">

<textarea id="output3">Yes</textarea>

Input4:

<textarea id="input4" rows="5" cols="80">

</textarea>

<input type="button" value="実行する" onClick="debug(4);">

<textarea id="output4"></textarea>


package main

import (
	"bufio"
	"fmt"
	"os"
)

var sc = bufio.NewScanner(os.Stdin)

const inf = 1 << 60
const mod int = 1e9 + 7

func ri() (n int) {
	sc.Scan()
	for _, v := range sc.Bytes() {
		n = n*10 + int(v-48)
	}
	return
}

func main() {
	sc.Split(bufio.ScanWords)
	n := ri()

	h := make([]int, n)
	for i := 0; i < n; i++ {
		h[i] = ri()
	}

	prev := -1
	ok := true
	for _, now := range h {
		// fmt.Println(prev, now)
		if prev <= now {
			if now > prev {
				now--
			}
			prev = now
			continue
		} else {
			ok = false
			break
		}
	}

	if ok {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}


package main

import (
	"bufio"
	"fmt"
	"os"
)

var sc = bufio.NewScanner(os.Stdin)

func ri() (n int) {
	sc.Scan()
	for _, v := range sc.Bytes() {
		n = n*10 + int(v-48)
	}
	return
}

func main() {
	sc.Split(bufio.ScanWords)
	n := ri()
	h := make([]int, n)
	for i := 0; i < n; i++ {
		h[i] = ri()
	}

	ok := true
	prev := -1
	for _, now := range h {
		if prev > now {
			ok = false
			break
		} else if prev < now {
			now--
		}
		prev = now
	}

	if ok {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}


package main

import (
	"bufio"
	"fmt"
	"os"
)

var sc = bufio.NewScanner(os.Stdin)

const inf = 1 << 60
const mod int = 1e9 + 7

func ri() (n int) {
	sc.Scan()
	for _, v := range sc.Bytes() {
		n = n*10 + int(v-48)
	}
	return
}

func main() {
	sc.Split(bufio.ScanWords)
	n := ri()

	h := make([]int, n)
	for i := 0; i < n; i++ {
		h[i] = ri()
	}

	h = append([]int{-1}, h...)
	ok := true
	for i := 1; i < len(h); i++ {
		switch {
		case h[i-1] > h[i]:
			ok = false
			break
		case h[i-1] < h[i]:
			h[i]--
		}
	}

	if ok {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}


//go:generate echo "https://atcoder.jp/contests/abc136/tasks/abc136_c"
package main

import (
	"bufio"
	"fmt"
	"io"
	"math/big"
	"os"
	"strconv"
)

var scan = newScanner(os.Stdin)

// 地道に減少させていこうとした、できなかった。
func solve() {
	N := scan.Int()
	Hs := scan.Ints(N)

	if N == 1 {
		fmt.Println("Yes")
		return
	}

	if d := Hs[0] - Hs[1]; d > 1 {
		fmt.Println("No")
		return
	} else if d == 1 {
		Hs[0]--
	}

	for i := 1; i < N-1; i++ {
		if d := Hs[i] - Hs[i+1]; d > 1 {
			fmt.Println("No")
			return
		} else if d == 1 {
			if Hs[i-1] == Hs[i] {
				fmt.Println("No")
				return
			}
			Hs[i]--
		}
	}

	fmt.Println("Yes")
	return
}

// 単調減少区間の長さが２以上であれば不可能
// しゃくとり法
func solve2() {
	N := scan.Int()
	Hs := scan.Ints(N)

	r := 1
	for l := 0; l < len(Hs); l++ {
		for r < len(Hs) && (r <= l || Hs[r-1]-Hs[r] >= 0) {
			r++
		}
		if r-l-1 > 1 && Hs[l]-Hs[r-1] > 1 {
			fmt.Println("No")
			return
		}
		if l == r {
			r++
		}
	}

	fmt.Println("Yes")
	return
}

func main() {
	solve2()
}

type scanner struct {
	*bufio.Scanner
}

func newScanner(r io.Reader) *scanner {
	s := bufio.NewScanner(r)
	s.Split(bufio.ScanWords)
	s.Buffer(nil, 100000000)
	return &scanner{s}
}

func (s *scanner) String() string {
	s.Scan()
	return s.Text()
}

func (s *scanner) Strings(l int) []string {
	if l == 0 {
		return []string{}
	}
	sl := make([]string, l, l)
	for i := range sl {
		sl[i] = s.String()
	}
	return sl
}

func (s *scanner) Int() int {
	n, _ := strconv.Atoi(s.String())
	return n
}

func (s *scanner) Ints(l int) []int {
	if l == 0 {
		return []int{}
	}
	sl := make([]int, l, l)
	for i := range sl {
		sl[i] = s.Int()
	}
	return sl
}

func (s *scanner) Float64() float64 {
	f, _ := strconv.ParseFloat(s.String(), 64)
	return f
}

func (s *scanner) Float64s(l int) []float64 {
	if l == 0 {
		return []float64{}
	}
	sl := make([]float64, l, l)
	for i := range sl {
		sl[i] = s.Float64()
	}
	return sl
}

func (s *scanner) BigInt() *big.Int {
	n, _ := strconv.ParseInt(s.String(), 10, 64)
	return big.NewInt(n)
}

func (s *scanner) BigInts(l int) []*big.Int {
	if l == 0 {
		return []*big.Int{}
	}
	sl := make([]*big.Int, l, l)
	for i := range sl {
		sl[i] = s.BigInt()
	}
	return sl
}

func iabs(x int) int {
	if x < 0 {
		return -x
	}
	return x
}

func imax(x, y int) int {
	if x > y {
		return x
	}
	return y
}

func imin(x, y int) int {
	if x < y {
		return x
	}
	return y
}

func ipow(x, n int) int {
	if n == 0 {
		return 1
	}
	a := ipow(x, n>>1)
	a *= a
	if n&1 != 0 {
		a *= x
	}
	return a
}

func isum(X []int) int {
	s := 0
	for _, x := range X {
		s += x
	}
	return s
}

func chmax(x *int, v int) {
	if *x < v {
		*x = v
	}
}

func chmin(x *int, v int) {
	if *x > v {
		*x = v
	}
}

func factor(n int) map[int]int {
	m := map[int]int{}
	for i := 2; i*i <= n; i++ {
		for n%i == 0 {
			n /= i
			m[i]++
		}
	}
	if n != 1 {
		m[n]++
	}
	return m
}

var mod = 1000000007

func setMintMod(x int) {
	mod = x
}

type mint int

func newMint(v int) mint {
	return mint((v%mod + mod) % mod)
}

func (x mint) Add(y mint) mint {
	v := x + y
	if v >= mint(mod) {
		return v - mint(mod)
	}
	return v
}

func (x mint) Sub(y mint) mint {
	v := x + mint(mod) - y
	if v >= mint(mod) {
		return v - mint(mod)
	}
	return v
}

func (x mint) Mul(y mint) mint {
	return (x * y) % mint(mod)
}

func (x mint) pow(n int) mint {
	if n == 0 {
		return mint(1)
	}
	a := x.pow(n >> 1)
	a = a.Mul(a)
	if n&1 != 0 {
		a = a.Mul(x)
	}
	return a
}

func (x mint) Inverse() mint {
	return x.pow(mod - 2)
}

func (x mint) Div(y mint) mint {
	return x * y.Inverse()
}

func (x mint) Neg() mint {
	return newMint(int(-x))
}

type factorial struct {
	fact        []mint
	factInverse []mint
}

func newFactorial(n int) *factorial {
	f := new(factorial)
	f.init(n)
	return f
}

func (f *factorial) init(n int) {
	fact := make([]mint, n+1, n+1)
	fact[0] = newMint(1)
	for i := 1; i <= n; i++ {
		fact[i] = fact[i-1].Mul(newMint(i))
	}

	inv := make([]mint, n+1, n+1)
	inv[n] = fact[n].Inverse()
	for i := n; i >= 1; i-- {
		inv[i-1] = inv[i].Mul(newMint(i))
	}

	f.fact = fact
	f.factInverse = inv
}

func (f *factorial) Get(n int) mint {
	return f.fact[n]
}

func (f *factorial) GetInverse(n int) mint {
	return f.factInverse[n]
}

func (f *factorial) Permutation(n, k int) mint {
	if k < 0 || n < k {
		return 0
	}
	return f.fact[n].Mul(f.factInverse[n-k])
}

func (f *factorial) Combination(n, k int) mint {
	if k < 0 || n < k {
		return 0
	}
	return f.fact[n].Mul(f.factInverse[k]).Mul(f.factInverse[n-k])
}

type sieve struct {
	n          int
	primes     []int
	maxFactors []int
}

func newSieve(n int) *sieve {
	s := &sieve{
		n:          n,
		primes:     []int{},
		maxFactors: make([]int, n+1, n+1),
	}
	s.init()
	return s
}

func (s *sieve) init() {
	s.maxFactors[0] = -1
	s.maxFactors[1] = -1
	for i := 2; i <= s.n; i++ {
		if s.maxFactors[i] != 0 {
			continue
		}
		s.primes = append(s.primes, i)
		s.maxFactors[i] = i
		for j := i * i; j <= s.n; j += i {
			if s.maxFactors[j] == 0 {
				s.maxFactors[j] = i
			}
		}
	}
}

func (s *sieve) IsPrime(x int) bool {
	return s.maxFactors[x] == x
}

func (s *sieve) Factor(x int) map[int]int {
	m := map[int]int{}
	for x != 1 {
		m[s.maxFactors[x]]++
		x /= s.maxFactors[x]
	}
	return m
}


//go:generate echo "https://atcoder.jp/contests/abc136/tasks/abc136_c"
package main

import (
	"bufio"
	"fmt"
	"io"
	"math/big"
	"os"
	"strconv"
)

var scan = newScanner(os.Stdin)

// 地道に減少させていこうとした、できなかった。
func solve() {
	N := scan.Int()
	Hs := scan.Ints(N)

	if N == 1 {
		fmt.Println("Yes")
		return
	}

	if d := Hs[0] - Hs[1]; d > 1 {
		fmt.Println("No")
		return
	} else if d == 1 {
		Hs[0]--
	}

	for i := 1; i < N-1; i++ {
		if d := Hs[i] - Hs[i+1]; d > 1 {
			fmt.Println("No")
			return
		} else if d == 1 {
			if Hs[i-1] == Hs[i] {
				fmt.Println("No")
				return
			}
			Hs[i]--
		}
	}

	fmt.Println("Yes")
	return
}

// 単調減少区間の長さが２以上であれば不可能
// しゃくとり法
func solve2() {
	N := scan.Int()
	Hs := scan.Ints(N)

	r := 1
	for l := 0; l < len(Hs); l++ {
		for r < len(Hs) && (r <= l || Hs[r-1]-Hs[r] > 0) {
			r++
		}
		if r-l-1 > 1 {
			fmt.Println("No")
			return
		}
		if l == r {
			r++
		}
	}

	fmt.Println("Yes")
	return
}

func main() {
	solve2()
}

type scanner struct {
	*bufio.Scanner
}

func newScanner(r io.Reader) *scanner {
	s := bufio.NewScanner(r)
	s.Split(bufio.ScanWords)
	s.Buffer(nil, 100000000)
	return &scanner{s}
}

func (s *scanner) String() string {
	s.Scan()
	return s.Text()
}

func (s *scanner) Strings(l int) []string {
	if l == 0 {
		return []string{}
	}
	sl := make([]string, l, l)
	for i := range sl {
		sl[i] = s.String()
	}
	return sl
}

func (s *scanner) Int() int {
	n, _ := strconv.Atoi(s.String())
	return n
}

func (s *scanner) Ints(l int) []int {
	if l == 0 {
		return []int{}
	}
	sl := make([]int, l, l)
	for i := range sl {
		sl[i] = s.Int()
	}
	return sl
}

func (s *scanner) Float64() float64 {
	f, _ := strconv.ParseFloat(s.String(), 64)
	return f
}

func (s *scanner) Float64s(l int) []float64 {
	if l == 0 {
		return []float64{}
	}
	sl := make([]float64, l, l)
	for i := range sl {
		sl[i] = s.Float64()
	}
	return sl
}

func (s *scanner) BigInt() *big.Int {
	n, _ := strconv.ParseInt(s.String(), 10, 64)
	return big.NewInt(n)
}

func (s *scanner) BigInts(l int) []*big.Int {
	if l == 0 {
		return []*big.Int{}
	}
	sl := make([]*big.Int, l, l)
	for i := range sl {
		sl[i] = s.BigInt()
	}
	return sl
}

func iabs(x int) int {
	if x < 0 {
		return -x
	}
	return x
}

func imax(x, y int) int {
	if x > y {
		return x
	}
	return y
}

func imin(x, y int) int {
	if x < y {
		return x
	}
	return y
}

func ipow(x, n int) int {
	if n == 0 {
		return 1
	}
	a := ipow(x, n>>1)
	a *= a
	if n&1 != 0 {
		a *= x
	}
	return a
}

func isum(X []int) int {
	s := 0
	for _, x := range X {
		s += x
	}
	return s
}

func chmax(x *int, v int) {
	if *x < v {
		*x = v
	}
}

func chmin(x *int, v int) {
	if *x > v {
		*x = v
	}
}

func factor(n int) map[int]int {
	m := map[int]int{}
	for i := 2; i*i <= n; i++ {
		for n%i == 0 {
			n /= i
			m[i]++
		}
	}
	if n != 1 {
		m[n]++
	}
	return m
}

var mod = 1000000007

func setMintMod(x int) {
	mod = x
}

type mint int

func newMint(v int) mint {
	return mint((v%mod + mod) % mod)
}

func (x mint) Add(y mint) mint {
	v := x + y
	if v >= mint(mod) {
		return v - mint(mod)
	}
	return v
}

func (x mint) Sub(y mint) mint {
	v := x + mint(mod) - y
	if v >= mint(mod) {
		return v - mint(mod)
	}
	return v
}

func (x mint) Mul(y mint) mint {
	return (x * y) % mint(mod)
}

func (x mint) pow(n int) mint {
	if n == 0 {
		return mint(1)
	}
	a := x.pow(n >> 1)
	a = a.Mul(a)
	if n&1 != 0 {
		a = a.Mul(x)
	}
	return a
}

func (x mint) Inverse() mint {
	return x.pow(mod - 2)
}

func (x mint) Div(y mint) mint {
	return x * y.Inverse()
}

func (x mint) Neg() mint {
	return newMint(int(-x))
}

type factorial struct {
	fact        []mint
	factInverse []mint
}

func newFactorial(n int) *factorial {
	f := new(factorial)
	f.init(n)
	return f
}

func (f *factorial) init(n int) {
	fact := make([]mint, n+1, n+1)
	fact[0] = newMint(1)
	for i := 1; i <= n; i++ {
		fact[i] = fact[i-1].Mul(newMint(i))
	}

	inv := make([]mint, n+1, n+1)
	inv[n] = fact[n].Inverse()
	for i := n; i >= 1; i-- {
		inv[i-1] = inv[i].Mul(newMint(i))
	}

	f.fact = fact
	f.factInverse = inv
}

func (f *factorial) Get(n int) mint {
	return f.fact[n]
}

func (f *factorial) GetInverse(n int) mint {
	return f.factInverse[n]
}

func (f *factorial) Permutation(n, k int) mint {
	if k < 0 || n < k {
		return 0
	}
	return f.fact[n].Mul(f.factInverse[n-k])
}

func (f *factorial) Combination(n, k int) mint {
	if k < 0 || n < k {
		return 0
	}
	return f.fact[n].Mul(f.factInverse[k]).Mul(f.factInverse[n-k])
}

type sieve struct {
	n          int
	primes     []int
	maxFactors []int
}

func newSieve(n int) *sieve {
	s := &sieve{
		n:          n,
		primes:     []int{},
		maxFactors: make([]int, n+1, n+1),
	}
	s.init()
	return s
}

func (s *sieve) init() {
	s.maxFactors[0] = -1
	s.maxFactors[1] = -1
	for i := 2; i <= s.n; i++ {
		if s.maxFactors[i] != 0 {
			continue
		}
		s.primes = append(s.primes, i)
		s.maxFactors[i] = i
		for j := i * i; j <= s.n; j += i {
			if s.maxFactors[j] == 0 {
				s.maxFactors[j] = i
			}
		}
	}
}

func (s *sieve) IsPrime(x int) bool {
	return s.maxFactors[x] == x
}

func (s *sieve) Factor(x int) map[int]int {
	m := map[int]int{}
	for x != 1 {
		m[s.maxFactors[x]]++
		x /= s.maxFactors[x]
	}
	return m
}


//go:generate echo "https://atcoder.jp/contests/abc136/tasks/abc136_c"
package main

import (
	"bufio"
	"fmt"
	"io"
	"math/big"
	"os"
	"strconv"
)

var scan = newScanner(os.Stdin)

func solve() {
	N := scan.Int()
	Hs := scan.Ints(N)

	if N == 1 {
		fmt.Println("Yes")
		return
	}

	if d := Hs[0] - Hs[1]; d > 1 {
		fmt.Println("No")
		return
	} else if d == 1 {
		Hs[0]--
	}

	for i := 1; i < N-1; i++ {
		if d := Hs[i] - Hs[i+1]; d > 1 {
			fmt.Println("No")
			return
		} else if d == 1 {
			if Hs[i-1] == Hs[i] {
				fmt.Println("No")
				return
			}
			Hs[i]--
		}
	}

	fmt.Println("Yes")
	return
}

func main() {
	solve()
}

type scanner struct {
	*bufio.Scanner
}

func newScanner(r io.Reader) *scanner {
	s := bufio.NewScanner(r)
	s.Split(bufio.ScanWords)
	s.Buffer(nil, 100000000)
	return &scanner{s}
}

func (s *scanner) String() string {
	s.Scan()
	return s.Text()
}

func (s *scanner) Strings(l int) []string {
	if l == 0 {
		return []string{}
	}
	sl := make([]string, l, l)
	for i := range sl {
		sl[i] = s.String()
	}
	return sl
}

func (s *scanner) Int() int {
	n, _ := strconv.Atoi(s.String())
	return n
}

func (s *scanner) Ints(l int) []int {
	if l == 0 {
		return []int{}
	}
	sl := make([]int, l, l)
	for i := range sl {
		sl[i] = s.Int()
	}
	return sl
}

func (s *scanner) Float64() float64 {
	f, _ := strconv.ParseFloat(s.String(), 64)
	return f
}

func (s *scanner) Float64s(l int) []float64 {
	if l == 0 {
		return []float64{}
	}
	sl := make([]float64, l, l)
	for i := range sl {
		sl[i] = s.Float64()
	}
	return sl
}

func (s *scanner) BigInt() *big.Int {
	n, _ := strconv.ParseInt(s.String(), 10, 64)
	return big.NewInt(n)
}

func (s *scanner) BigInts(l int) []*big.Int {
	if l == 0 {
		return []*big.Int{}
	}
	sl := make([]*big.Int, l, l)
	for i := range sl {
		sl[i] = s.BigInt()
	}
	return sl
}

func iabs(x int) int {
	if x < 0 {
		return -x
	}
	return x
}

func imax(x, y int) int {
	if x > y {
		return x
	}
	return y
}

func imin(x, y int) int {
	if x < y {
		return x
	}
	return y
}

func ipow(x, n int) int {
	if n == 0 {
		return 1
	}
	a := ipow(x, n>>1)
	a *= a
	if n&1 != 0 {
		a *= x
	}
	return a
}

func isum(X []int) int {
	s := 0
	for _, x := range X {
		s += x
	}
	return s
}

func chmax(x *int, v int) {
	if *x < v {
		*x = v
	}
}

func chmin(x *int, v int) {
	if *x > v {
		*x = v
	}
}

func factor(n int) map[int]int {
	m := map[int]int{}
	for i := 2; i*i <= n; i++ {
		for n%i == 0 {
			n /= i
			m[i]++
		}
	}
	if n != 1 {
		m[n]++
	}
	return m
}

var mod = 1000000007

func setMintMod(x int) {
	mod = x
}

type mint int

func newMint(v int) mint {
	return mint((v%mod + mod) % mod)
}

func (x mint) Add(y mint) mint {
	v := x + y
	if v >= mint(mod) {
		return v - mint(mod)
	}
	return v
}

func (x mint) Sub(y mint) mint {
	v := x + mint(mod) - y
	if v >= mint(mod) {
		return v - mint(mod)
	}
	return v
}

func (x mint) Mul(y mint) mint {
	return (x * y) % mint(mod)
}

func (x mint) pow(n int) mint {
	if n == 0 {
		return mint(1)
	}
	a := x.pow(n >> 1)
	a = a.Mul(a)
	if n&1 != 0 {
		a = a.Mul(x)
	}
	return a
}

func (x mint) Inverse() mint {
	return x.pow(mod - 2)
}

func (x mint) Div(y mint) mint {
	return x * y.Inverse()
}

func (x mint) Neg() mint {
	return newMint(int(-x))
}

type factorial struct {
	fact        []mint
	factInverse []mint
}

func newFactorial(n int) *factorial {
	f := new(factorial)
	f.init(n)
	return f
}

func (f *factorial) init(n int) {
	fact := make([]mint, n+1, n+1)
	fact[0] = newMint(1)
	for i := 1; i <= n; i++ {
		fact[i] = fact[i-1].Mul(newMint(i))
	}

	inv := make([]mint, n+1, n+1)
	inv[n] = fact[n].Inverse()
	for i := n; i >= 1; i-- {
		inv[i-1] = inv[i].Mul(newMint(i))
	}

	f.fact = fact
	f.factInverse = inv
}

func (f *factorial) Get(n int) mint {
	return f.fact[n]
}

func (f *factorial) GetInverse(n int) mint {
	return f.factInverse[n]
}

func (f *factorial) Permutation(n, k int) mint {
	if k < 0 || n < k {
		return 0
	}
	return f.fact[n].Mul(f.factInverse[n-k])
}

func (f *factorial) Combination(n, k int) mint {
	if k < 0 || n < k {
		return 0
	}
	return f.fact[n].Mul(f.factInverse[k]).Mul(f.factInverse[n-k])
}

type sieve struct {
	n          int
	primes     []int
	maxFactors []int
}

func newSieve(n int) *sieve {
	s := &sieve{
		n:          n,
		primes:     []int{},
		maxFactors: make([]int, n+1, n+1),
	}
	s.init()
	return s
}

func (s *sieve) init() {
	s.maxFactors[0] = -1
	s.maxFactors[1] = -1
	for i := 2; i <= s.n; i++ {
		if s.maxFactors[i] != 0 {
			continue
		}
		s.primes = append(s.primes, i)
		s.maxFactors[i] = i
		for j := i * i; j <= s.n; j += i {
			if s.maxFactors[j] == 0 {
				s.maxFactors[j] = i
			}
		}
	}
}

func (s *sieve) IsPrime(x int) bool {
	return s.maxFactors[x] == x
}

func (s *sieve) Factor(x int) map[int]int {
	m := map[int]int{}
	for x != 1 {
		m[s.maxFactors[x]]++
		x /= s.maxFactors[x]
	}
	return m
}


N = gets.to_i
H = gets.split.map(&:to_i)
result = "Yes"
top = H[-1]
H.reverse.each do |h|
  if h <= top
    top = h
  else
    if h-1 == top
      next
    else
      result = "No"
      break
    end
  end
end
puts result


N = gets.to_i
H = gets.split.map(&:to_i)

max = H[-1]
satisfied = true
H[0..-1].reverse.each do |h|
  if h <= max
    max = h
  else
    if h - 1 == max
      next
    else
      satisfied = false
      break
    end
  end
end

if satisfied
  puts 'Yes'
else
  puts 'No'
end


N = gets.to_i
heights = gets.split.map(&:to_i)
answer = true
previous = heights.shift
heights.each do |current|
  if previous < current
    # OKなパターン
    # 念の為、一つ下げておく（下げてもpreviousと同じかそれより上）
    previous = current - 1
  elsif previous == current
    # これもOKなパターン。
    #　高さはpreviousのまま。
  elsif previous == current - 1
    # 1減らして同じ高さになったパターン
    # この場合には高さはpreviousのまま
  else # previous > current - 1
    # Failedパターン
    answer = false
    break
  end
end
puts answer ? "Yes" : "No"


n = gets.to_i
num = gets.strip.split.map(&:to_i)
if n==1
  puts "Yes"
  exit
end
s = 1
i = 0
while i < n-1 do
  if num[i]==num[i+1]+1
    num[i] -= 1
  elsif num[i]>num[i+1]+1
    s = 0
    break
  end
  i += 1
end
if s==0
  puts "No"
else
  if num.sort == num
    puts "Yes"
  else
    puts "No"
  end
end


n = gets.to_i
arr = gets.chomp.split(' ').map(&:to_i)
down_flag = 0
for i in 0..(n-2)
  if arr[i] > arr[i+1] + 1
    puts "No"
    exit
  elsif arr[i] == arr[i+1] + 1
    if down_flag == 1
      puts "No"
      exit
    else
      down_flag = 1
    end
  elsif arr[i] <= arr[i+1]
    down_flag = 0
  end
end
puts "Yes"


n = gets.chomp.to_i
h = gets.chomp.split(" ").map(&:to_i)
i = 1
while true
    if n == 1
        puts "Yes"
        exit
       end
   if  h[i-1] -1 > h[i]
     puts "No"
     exit
   end
   i += 1
   if i == h.size
    puts "Yes"
    exit
   end
end


/*------------------------------------------------------------------*/
/*------------------------- begin template -------------------------*/
/*------------------------------------------------------------------*/

// ref: tanakh <https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8>
// diff: using Parser
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut parser = Parser::from_str($s);
        input_inner!{parser, $($r)*}
    };
    (parser = $parser:ident, $($r:tt)*) => {
        input_inner!{$parser, $($r)*}
    };
    (new_stdin_parser = $parser:ident, $($r:tt)*) => {
        let stdin = std::io::stdin();
        let reader = std::io::BufReader::new(stdin.lock());
        let mut $parser = Parser::new(reader);
        input_inner!{$parser, $($r)*}
    };
    ($($r:tt)*) => {
        input!{new_stdin_parser = parser, $($r)*}
    };
}

macro_rules! input_inner {
    ($parser:ident) => {};
    ($parser:ident, ) => {};
    ($parser:ident, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($parser, $t);
        input_inner!{$parser $($r)*}
    };
}

macro_rules! read_value {
    ($parser:ident, ( $($t:tt),* )) => {
        ( $(read_value!($parser, $t)),* )
    };
    ($parser:ident, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($parser, $t)).collect::<Vec<_>>()
    };
    ($parser:ident, chars) => {
        read_value!($parser, String).chars().collect::<Vec<char>>()
    };
    ($parser:ident, char_) => {
        read_value!($parser, String).chars().collect::<Vec<char>>()[0]
    };
    ($parser:ident, usize1) => {
        read_value!($parser, usize) - 1
    };
    ($parser:ident, i64_) => {
        $parser.fast_i64()
    };
    ($parser:ident, usize_) => {
        $parser.fast_i64() as usize
    };
    ($parser:ident, usize1_) => {
        ($parser.fast_i64() - 1) as usize
    };
    ($parser:ident, $t:ty) => {
        $parser.next::<$t>().expect("Parse error")
    };
}

use std::io;
use std::io::BufRead;
use std::str;

// ref: tatsuya6502 <https://qiita.com/tatsuya6502/items/cd448486f7ef7b5b8c7e>
// ref: wariuni <https://qiita.com/tatsuya6502/items/cd448486f7ef7b5b8c7e#comment-7040a5ae96305e884eb9>
// diff: using std::io::BufRead::fill_buf()
pub struct Parser<R> {
    pub reader: R,
    buf: Vec<u8>,
    pos: usize,
}

impl Parser<io::Empty> {
    pub fn from_str(s: &str) -> Parser<io::Empty> {
        Parser {
            reader: io::empty(),
            buf: s.as_bytes().to_vec(),
            pos: 0,
        }
    }
}

impl<R: BufRead> Parser<R> {
    pub fn new(reader: R) -> Parser<R> {
        Parser {
            reader: reader,
            buf: vec![],
            pos: 0,
        }
    }
    pub fn update_buf(&mut self) {
        self.buf.clear();
        self.pos = 0;
        loop {
            let (len, complete) = {
                let buf2 = self.reader.fill_buf().unwrap();
                self.buf.extend_from_slice(buf2);
                let len = buf2.len();
                (len, buf2[len - 1] <= 0x20)
            };
            self.reader.consume(len);
            if complete {
                break;
            }
        }
    }
    pub fn next<T: str::FromStr>(&mut self) -> Result<T, T::Err> {
        loop {
            let mut begin = self.pos;
            while begin < self.buf.len() && (self.buf[begin] <= 0x20) {
                begin += 1;
            }
            let mut end = begin;
            while end < self.buf.len() && (self.buf[end] > 0x20) {
                end += 1;
            }
            if begin != self.buf.len() {
                self.pos = end;
                return unsafe { str::from_utf8_unchecked(&self.buf[begin..end]) }.parse::<T>();
            } else {
                self.update_buf();
            }
        }
    }
    pub fn fast_i64(&mut self) -> i64 {
        loop {
            let mut begin = self.pos;
            while begin < self.buf.len() && (self.buf[begin] <= 0x20) {
                begin += 1;
            }
            if begin == self.buf.len() {
                self.update_buf();
                continue;
            }
            let mut res = 0;
            let (is_positive, mut end) = match self.buf[begin] {
                b'+' => (true, begin + 1),
                b'-' => (false, begin + 1),
                _ => (true, begin),
            };
            while end < self.buf.len() && (self.buf[end] > 0x20) {
                res = res * 10 + (self.buf[end] as i64 - '0' as i64);
                end += 1;
            }
            if begin != self.buf.len() {
                self.pos = end;
                return if is_positive { res } else { -res };
            } else {
                self.update_buf();
            }
        }
    }
}

#[allow(unused_imports)]
use std::cmp::*;

fn main() {
    input! {
        new_stdin_parser = parser,
    }
    let res = solve(&mut parser);
    print!("{}", res);
}

/*------------------------------------------------------------------*/
/*-------------------------- end template --------------------------*/
/*------------------------------------------------------------------*/

use std::fmt::Write;
fn solve<R: BufRead>(parser: &mut Parser<R>) -> String {
    let mut buf = String::new();
    input! {
        parser = parser,
        n: usize,
        xs: [i64; n],
    }
    let mut xs = xs;
    let mut res = true;
    for i in (0..n - 1).rev() {
        if xs[i] > xs[i + 1] {
            xs[i] -= 1;
            if xs[i] > xs[i + 1] {
                res = false;
                break;
            }
        }
    }
    writeln!(buf, "{}", if res { "Yes" } else { "No" });
    buf
}


fn read<T: std::str::FromStr>(
    stdin_lock: &mut std::io::StdinLock,
    buf: &mut Vec<u8>,
    delimiter: u8,
) -> T {
    buf.clear();
    let l = std::io::BufRead::read_until(stdin_lock, delimiter, buf).unwrap();
    buf.truncate(l - 1); // remove delimiter
    let s = unsafe { std::str::from_utf8_unchecked(&buf) };
    s.parse().unwrap_or_else(|_| panic!("read"))
}

fn main() {
    let stdin = std::io::stdin();
    let mut stdin_lock = stdin.lock();
    let mut buf: Vec<u8> = Vec::new();
    let n: usize = read(&mut stdin_lock, &mut buf, b'\n');
    let mut hv = vec![0i32; n];
    for i in 0..n - 1 {
        hv[i] = read(&mut stdin_lock, &mut buf, b' ');
    }
    hv[n - 1] = read(&mut stdin_lock, &mut buf, b'\n');

    let mut ans = true;
    let mut p = hv[0];
    for i in 0..n {
        if hv[i] == p {
            continue;
        } else if hv[i] > p {
            p = hv[i] - 1;
        } else {
            ans = false;
            break;
        }
    }
    println!("{}", if ans { "Yes" } else { "No" });
}


#[macro_use]
mod input {

use std;
use std::io;

const SPLIT_DELIMITER: char = ' ';

#[macro_export]
#[allow(unused_macros)]
macro_rules! input {
    ( $($x:expr ),*) => {
        {
            let temp_str = input_line_str();
            let mut split_result_iter = temp_str.split_whitespace();
                $(
                let buf_split_result = split_result_iter.next();
                let buf_split_result = buf_split_result.unwrap();
                    ($x) = buf_split_result.parse().unwrap();
                )*
        }
    };
}

#[allow(dead_code)]
pub fn input_line_str() -> String {
    let mut s = String::new();
    io::stdin().read_line(&mut s).unwrap();
    s.trim().to_string()
}

#[allow(dead_code)]
pub fn p<T>(t: T)
where
    T: std::fmt::Display,
{
    println!("{}", t);
}

#[allow(dead_code)]
pub fn input_vector2d<T>(line: usize) -> Vec<Vec<T>>
where
    T: std::str::FromStr,
{
    let mut v: Vec<Vec<T>> = Vec::new();

    for _ in 0..line {
        let vec_line = input_vector();
        v.push(vec_line);
    }
    v
}

#[allow(dead_code)]
pub fn input_vector<T>() -> Vec<T>
where
    T: std::str::FromStr,
{
    let mut v: Vec<T> = Vec::new();

    let s = input_line_str();
    let split_result = s.split(SPLIT_DELIMITER);
    for z in split_result {
        let buf = match z.parse() {
            Ok(r) => r,
            Err(_) => panic!("Parse Error"),
        };
        v.push(buf);
    }
    v
}

#[allow(dead_code)]
pub fn str2vec(s: &str) -> Vec<char> {
    let mut v: Vec<char> = Vec::new();
    for c in s.chars() {
        v.push(c);
    }
    v
}

}

use input::*;

fn main() {
    let n: usize;
    input!(n);
    let mut v = input_vector::<usize>();
    let mut flag = true;
    let mut prev = 0;

    for z in &mut v {
        if prev < *z {
            *z -= 1;
        }
        if prev > *z {
            flag = false;
            break;
        }
        prev = *z;
    }
    if flag {
        p("Yes");
    } else {
        p("No");
    }
}


use std::cmp::max;
use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("filed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let n:usize = read();
    let mut v:Vec<u128> = (0..n).map(|_| read()).collect();
    let mut mx = v[0];
    let mut ans = "Yes";
    for i in 1..n {
        if v[i] < v[i-1] {
            v[i-1] -= 1;
        }
        mx = max(mx, v[i-1]);
        if v[i] < mx {
            ans = "No";
            break;
        }
    }
    println!("{}", ans);
}


use std::cmp::max;
use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("filed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let n:usize = read();
    let mut v:Vec<usize> = (0..n).map(|_| read()).collect();
    let mut mx = v[0];
    let mut ans = "Yes";
    for i in 1..n {
        if v[i] < v[i-1] {
            v[i-1] -= 1;
        }
        mx = max(mx, v[i-1]);
        if v[i] < mx {
            ans = "No";
            break;
        }
    }
    println!("{}", ans);
}


use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("filed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let n:usize = read();
    let mut v:Vec<usize> = (0..n).map(|_| read()).collect();
    for i in 1..n {
        if v[i] < v[i-1] {
            v[i-1] -= 1;
        }
    }
    let mut c = v.clone();
    c.sort();
    if c == v {
        println!("Yes");
    } else {
        println!("No");
    }
}


// 🐋💭
import Foundation

func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}

func readInt() -> Int {
    return Int(readLine()!)!
}

func readDoubles () -> [Double] {
    return readLine()!.split(separator: " ").map { Double($0)! }
}

func readDouble() -> Double{
    return Double(readLine()!)!
}
///最大公約数を返す
func gcd(_ m:Int, _ n:Int) -> Int {
    if n == 0 {return m}
    return gcd(n, m % n)
}

///素数判定(試し割り)
func isPrime(_ x:Int) -> Bool {
    if x <= 1 || x % 2 == 0 { return false }
    if x == 2 { return true }
    for i in stride(from: 3, to: Int(ceil(sqrt(Double(x)))), by: 2){
        if x % i == 0 {
            return false
        }
    }
    return true
}

//https://program-life.com/669
///実行速度の計測
func exectionTime(action: () -> Void) {
    let startDate = Date()
    action()
    let endDate = Date()
    print(endDate.timeIntervalSince(startDate))
}

// https://melheaven.hatenadiary.jp/entry/atcoder144
///約数の配列を返す
func makeDivisors(_ n:Int) -> [Int] {
    var divisors = [Int]()
    for i in 1..<Int(pow(Double(n), 0.5)) + 1 {
        if n % i == 0{
            divisors.append(i + n / i)
        }
    }

    return divisors
}

//https://riptutorial.com/ja/swift/example/14738/インデックスを知らずに配列から要素を削除する
extension Array where Element: Equatable {

    mutating func remove(_ element: Element) {
        _ = index(of: element).flatMap {
            self.remove(at: $0)
        }
    }
}

func binarySearch(rifgt:Int, key:Int, ary:[String]) -> Int{
    var left = 0
    var right = rifgt

    while abs(right - left) > 1 {
        let mid = left + (right - left) / 2

        if Int(ary[mid])! < key {
            left = mid

        } else {
            right = mid
        }
    }
    return left
}

func arrangement (prev:String, ary:[String], returnVal:[String]) -> [String] {
    var returnVal = returnVal
    if ary.count == 0 {
        returnVal.append(prev)
        return returnVal
    }

    for s in ary {
        let wprev = prev + s
        var wary = ary
        wary.remove(s)
        returnVal = arrangement(prev: wprev, ary: wary, returnVal: returnVal)
    }
    return returnVal
}

func main() {
    let n = readInt()
    var aryH = readInts()
    //＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿ここまで入力
    aryH.reverse()

    for i in 1..<n {
        if aryH[i - 1] < aryH[i] {
            aryH[i] -= 1
            if aryH[i - 1] < aryH[i] {
                print("No")
                return
            }
        }
    }
    print("Yes")

}
main()


import Foundation
import CoreFoundation

#if swift(>=4.0)
#else
extension String {
    func split(separator separator: Character) -> [String] {
        return self.characters.split(separator).map{String($0)}
    }
    var count: Int {
        return self.characters.count
    }
    func uppercased() -> String {
        return self.uppercaseString
    }
    func lowercased() -> String {
        return self.lowercaseString
    }
}
extension Array where Element: Comparable {
    func max() -> Element? {
        return self.maxElement()
    }
    func min() -> Element? {
        return self.minElement()
    }
    func sorted() -> Array {
        return self.sort()
    }
    mutating func sort() {
        self.sortInPlace()
    }
}
extension Array {
    mutating func swapAt(i: Int, _ j: Int) {
        swap(&self[i], &self[j])
    }
    func joined(separator separator: String = " ") -> String {
        return self.map{String($0)}.joinWithSeparator(separator)
    }
    func reversed() -> Array {
        return self.reverse()
    }
    mutating func reverse() {
        self = self.reversed()
    }
    func enumerated() -> EnumerateSequence<[Element]> {
        return self.enumerate()
    }
    init(repeating: Element, count: Int) {
        self.init(count: count, repeatedValue: repeating)
    }
}
func stride<T: Strideable>(from start: T, to end: T, by stride: T.Stride) -> StrideTo<T> {
    return start.stride(to: end, by: stride)
}
#endif
func readInt() -> Int? {
    return Int(readLine()!)
}
func readStringSplit(by separator: Character = " ") -> [String] {
    return readLine()!.split(separator: separator)
}
func readIntSplit(by separator: Character = " ") -> [Int] {
    return readLine()!.split(separator: separator).map{Int($0)!}
}
prefix operator * { }
prefix func * <T> (a: [T]) -> (T, T)          { return (a[0], a[1]) }
prefix func * <T> (a: [T]) -> (T, T, T)       { return (a[0], a[1], a[2]) }
prefix func * <T> (a: [T]) -> (T, T, T, T)    { return (a[0], a[1], a[2], a[3]) }
prefix func * <T> (a: [T]) -> (T, T, T, T, T) { return (a[0], a[1], a[2], a[3], a[4]) }
infix operator ** { associativity right precedence 155 }    // 右結合，乗除算より強くビットシフトより弱い
func **(lhs: Int, rhs: Int) -> Int {
    return (0..<rhs).reduce(1){i,_ in i*lhs}
}
func **(lhs: Int, rhs: Double) -> Double {
    return pow(Double(lhs), rhs)
}
//func gcd(x: Int, _ y: Int) -> Int {
//    return y>0 ? gcd(y, x%y) : x
//}
//func lcm(x: Int, _ y: Int) -> Int {
//    return x * y / gcd(x, y)
//}
let MOD = 10**9+7

/*************** テストスペース ***************/

//arr.sort{$0.0==$1.0 ? $0.1<$1.1 : $0.0<$1.0}  // タプル配列のソート

/*************** メインプログラム ***************/

let N = readInt()!
var H = readIntSplit()
for i in (0..<N-1).reverse() {
    if H[i] > H[i+1] {
        H[i] -= 1
    }
}
var ans = "Yes"
for i in 0..<N-1 {
    if H[i] > H[i+1] {
        ans = "No"
        break
    }
}
print(ans)


let range = (0..<Int(readLine()!)!-1).reverse()
var H = readLine()!.characters.split(" ").map{Int(String($0))!}
for i in range {
    if H[i] > H[i+1] {
        H[i] -= 1
    }
}
var ans = "Yes"
for i in range {
    if H[i] > H[i+1] {
        ans = "No"
    }
}
print(ans)


// 🐋💭
import Foundation

func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}

func readInt() -> Int {
    return Int(readLine()!)!
}

func readDoubles () -> [Double] {
    return readLine()!.split(separator: " ").map { Double($0)! }
}

func readDouble() -> Double{
    return Double(readLine()!)!
}
///最大公約数を返す
func gcd(_ m:Int, _ n:Int) -> Int {
    if n == 0 {return m}
    return gcd(n, m % n)
}

///素数判定(試し割り)
func isPrime(_ x:Int) -> Bool {
    if x <= 1 || x % 2 == 0 { return false }
    if x == 2 { return true }
    for i in stride(from: 3, to: Int(ceil(sqrt(Double(x)))), by: 2){
        if x % i == 0 {
            return false
        }
    }
    return true
}

//https://program-life.com/669
///実行速度の計測
func exectionTime(action: () -> Void) {
    let startDate = Date()
    action()
    let endDate = Date()
    print(endDate.timeIntervalSince(startDate))
}

// https://melheaven.hatenadiary.jp/entry/atcoder144
///約数の配列を返す
func makeDivisors(_ n:Int) -> [Int] {
    var divisors = [Int]()
    for i in 1..<Int(pow(Double(n), 0.5)) + 1 {
        if n % i == 0{
            divisors.append(i + n / i)
        }
    }

    return divisors
}

//https://riptutorial.com/ja/swift/example/14738/インデックスを知らずに配列から要素を削除する
extension Array where Element: Equatable {

    mutating func remove(_ element: Element) {
        _ = index(of: element).flatMap {
            self.remove(at: $0)
        }
    }
}

func binarySearch(rifgt:Int, key:Int, ary:[String]) -> Int{
    var left = 0
    var right = rifgt

    while abs(right - left) > 1 {
        let mid = left + (right - left) / 2

        if Int(ary[mid])! < key {
            left = mid

        } else {
            right = mid
        }
    }
    return left
}

func arrangement (prev:String, ary:[String], returnVal:[String]) -> [String] {
    var returnVal = returnVal
    if ary.count == 0 {
        returnVal.append(prev)
        return returnVal
    }

    for s in ary {
        let wprev = prev + s
        var wary = ary
        wary.remove(s)
        returnVal = arrangement(prev: wprev, ary: wary, returnVal: returnVal)
    }
    return returnVal
}

func main() {
    let n = readInt()
    var aryH = readInts()
    //＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿ここまで入力
    aryH.reverse()
    print(aryH)

    for i in 1..<n {
        if aryH[i - 1] < aryH[i] {
            aryH[i] -= 1
            if aryH[i - 1] < aryH[i] {
                print("No")
                return
            }
        }
    }
    print("Yes")

}
main()


let n=Int(readLine()!)!
var arr=readLine()!.characters.split{$0==" "}.map{Int(String($0))!}

var i = 0
var p = arr[0]
var ret : String = ""
for i in 1..<n {
  let d = arr[i] - arr[i - 1]
  if(  d < -1 ) {
    break
  } else if( d < 0 ) {
    arr[i - 1] -= 1
  }
}

for i in 1..<n {
  if( arr[i] < arr[i - 1] ) {
    ret = "No"
    break
  }
}

if( ret == "" ) {
  print( "Yes" )
} else {
  print( "No" )
}


import Foundation
import CoreFoundation

#if swift(>=4.0)
#else
extension String {
    func split(separator separator: Character) -> [String] {
        return self.characters.split(separator).map{String($0)}
    }
    var count: Int {
        return self.characters.count
    }
    func uppercased() -> String {
        return self.uppercaseString
    }
    func lowercased() -> String {
        return self.lowercaseString
    }
}
extension Array where Element: Comparable {
    func max() -> Element? {
        return self.maxElement()
    }
    func min() -> Element? {
        return self.minElement()
    }
    func sorted() -> Array {
        return self.sort()
    }
    mutating func sort() {
        self.sortInPlace()
    }
}
extension Array {
    mutating func swapAt(i: Int, _ j: Int) {
        swap(&self[i], &self[j])
    }
    func joined(separator separator: String = " ") -> String {
        return self.map{String($0)}.joinWithSeparator(separator)
    }
    func reversed() -> Array {
        return self.reverse()
    }
    mutating func reverse() {
        self = self.reversed()
    }
    func enumerated() -> EnumerateSequence<[Element]> {
        return self.enumerate()
    }
    init(repeating: Element, count: Int) {
        self.init(count: count, repeatedValue: repeating)
    }
}
func stride<T: Strideable>(from start: T, to end: T, by stride: T.Stride) -> StrideTo<T> {
    return start.stride(to: end, by: stride)
}
#endif
func readInt() -> Int? {
    return Int(readLine()!)
}
func readStringSplit(by separator: Character = " ") -> [String] {
    return readLine()!.split(separator: separator)
}
func readIntSplit(by separator: Character = " ") -> [Int] {
    return readLine()!.split(separator: separator).map{Int($0)!}
}
prefix operator * { }
prefix func * <T> (a: [T]) -> (T, T)          { return (a[0], a[1]) }
prefix func * <T> (a: [T]) -> (T, T, T)       { return (a[0], a[1], a[2]) }
prefix func * <T> (a: [T]) -> (T, T, T, T)    { return (a[0], a[1], a[2], a[3]) }
prefix func * <T> (a: [T]) -> (T, T, T, T, T) { return (a[0], a[1], a[2], a[3], a[4]) }
infix operator ** { associativity right precedence 155 }    // 右結合，乗除算より強くビットシフトより弱い
func **(lhs: Int, rhs: Int) -> Int {
    return (0..<rhs).reduce(1){i,_ in i*lhs}
}
func **(lhs: Int, rhs: Double) -> Double {
    return pow(Double(lhs), rhs)
}
//func gcd(x: Int, _ y: Int) -> Int {
//    return y>0 ? gcd(y, x%y) : x
//}
//func lcm(x: Int, _ y: Int) -> Int {
//    return x * y / gcd(x, y)
//}
let MOD = 10**9+7

/*************** テストスペース ***************/

//arr.sort{$0.0==$1.0 ? $0.1<$1.1 : $0.0<$1.0}  // タプル配列のソート

/*************** メインプログラム ***************/

let N = readInt()!
var H = readIntSplit()
for i in 0..<N-1 {
    if H[i] > H[i+1] {
        H[i] -= 1
    }
}
var ans = "Yes"
for i in 0..<N-1 {
    if H[i] > H[i+1] {
        ans = "No"
        break
    }
}
print(ans)


'use strict'
const main = (input: string) => {
    const std: string[] = input.trim().split('\n');
    const n: number = ~~std.shift();
    let h: number[] = std[0].split(' ').map(Number);
    for (let i = 0; i < n-1; i++) {
        if (h[i] > h[i+1]) {
            return console.log("No");
        }
        if (h[i] < h[i+1]) {
            h[i+1]--;
        }
    }
    console.log("Yes");

}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));


function main(input) {
  input = input.trim().split("\n");
  const n = Number(input[0]);
  const hs = input[1].split(" ").map(a => Number(a));
  let prevH = 0;
  let result = "Yes";
  for (let i = 0; i < n-1; i++) {
    const h = hs[i];
    const nextH = hs[i+1];
    if (1 < h - nextH) {
      result = "No";
      break;
    } else if (h - nextH === 1) {
      if (i !== 0 && nextH < prevH) {
        result = "No";
        break;
      }
      prevH = nextH;
    } else {
      prevH = prevH < h ? h-1 : h;
    }
  }
  console.log(result);
}
main(require("fs").readFileSync("/dev/stdin", "utf8"));


const stdin = require('fs').readFileSync('/dev/stdin', 'utf8').trim()

const n = Number(stdin.split('\n')[0])
const h = stdin
  .split('\n')[1]
  .split(' ')
  .map(Number)

const ans = () => {
  let max = h[0]

  for (let i = 1; i < n; i++) {
    if (max - h[i] > 1) {
      return 'No'
    }

    max = Math.max(max, h[i])
  }

  return 'Yes'
}

console.log(ans())


'use strict'
const main = (input: string) => {
    const std: string[] = input.trim().split('\n');
    const n: number = ~~std.shift();
    let h: number[] = std[0].split(' ').map(Number);
    if (n === 1) {
        console.log("Yes");
        return;
    }
    for (let i = 1; i < h.length-1; i++) {
        if ((h[i] - h[i-1] >= 3) && (h[i+1] - h[i] >= 3)) {
            console.log("No");
            return;
        }
        if (i+1 === h.length -1 && (h[i+1] > h[i] || h[i+1]+1 > h[i])) {
            console.log("Yes");
            return;
        }
        if (i+1 === h.length -1 && (h[i+1] <= h[i] || h[i+1]+1 <= h[i])) {
            console.log("No");
            return;
        }
    }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));


'use strict'
const main = (input: string) => {
    const std: string[] = input.trim().split('\n');
    const n: number = ~~std.shift();
    let h: number[] = std[0].split(' ').map(Number);
    for (let i = 1; i < h.length-1; i++) {
        if ((h[i] - h[i-1] >= 3) && (h[i+1] - h[i] >= 3)) {
            console.log("No");
            return;
        }
        if (i+1 === h.length -1 && (h[i+1] > h[i] || h[i+1]+1 > h[i])) {
            console.log("Yes");
            return;
        }
        if (i+1 === h.length -1 && (h[i+1] <= h[i] || h[i+1]+1 <= h[i])) {
            console.log("No");
            return;
        }
    }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));


#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<stdio.h>
#include<functional>

#define vec2c vector<vector<char>>
#define vec2i vector<vector<int>>
#define vecc vector<char>
#define vecs vector<string>
#define veci vector<int>
#define vecd vector<double>
#define rep(i, n) for(int i=0; i < (int)(n); i++)
#define rrep(i, n) for(int i=(int)(n); i>=0;i--)

using namespace std;

int main() {

  int n;
  veci h;

  cin >> n;
  rep(i, n) {
    int x;
    cin >> x;
    h.push_back(x);
  }

  for(int i=0; i<n-1; i++) {
    if (h[i] == h[i+1]) {
      continue;
    }
    else if (h[i] <= h[i+1] - 1) {
      h[i+1]--;
      continue;
    }
    else {
      cout << "No" << endl;
      return 0;
    }
  }

  cout << "Yes" << endl;
  return 0;
}


c=open(0).read().count
for s in'AC','WA','TLE','RE':print(s, 'x',c(s))


s = open(0).read().count
for r in "AC", "WA", "TLE", "RE":
    print(r, "x", s(r))


c=open(0).read().count
for s in'AC','WA','TLE','RE':print(s,'x',c(s))


# listじゃなくてdict使いたい
n = int(input())
j = [0] * 4
for i in range(n):
    s=input()
    if s == "AC":
        j[0] += 1
    elif s=="WA":
        j[1] += 1
    elif s=="TLE":
        j[2] += 1
    elif s == "RE":
        j[3] += 1
for k in range(4):
    print(f"AC x {j[k]}")


# listじゃなくてdict使いたい
n = int(input())
j = [0] * 4
for i in range(n):
    s=input()
    if s == "AC":
        j[0] += 1
    elif s=="WA":
        j[1] += 1
    elif s=="TLE":
        j[2] += 1
    elif s == "RE":
        j[3] += 1
for k in range(4):
    print(f"AC × {j[k]}")


N=int(input())
ac=0
wa=0
tle=0
re=0
for _ in range(N):
  s=input()
  if 'AC'==s:
     ac+=1
  elif 'WA'==s:
    wa+=1
  elif 'TLE'==s:
    tle+=1
  elif 'RE'==s:
    re+=1
print('AC',x,ac)
print('WA',x,wa)
print('TLE',x,tle)
print('RE',x,re)


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author KharYusuf
 */
public class Main {
    public static void main(String[] args) throws Exception {
        Thread thread = new Thread(null, new TaskAdapter(), "KharYusuf", 1 << 27);
        thread.start();
        thread.join();
    }

    static class TaskAdapter implements Runnable {
        @Override
        public void run() {
            InputStream inputStream = System.in;
            OutputStream outputStream = System.out;
            FastReader in = new FastReader(inputStream);
            PrintWriter out = new PrintWriter(outputStream);
            BJudgeStatusSummary solver = new BJudgeStatusSummary();
            solver.solve(1, in, out);
            out.close();
        }
    }

    static class BJudgeStatusSummary {
        public void solve(int testNumber, FastReader s, PrintWriter w) {
            int[] f = new int['Z' + 1];
            int n = s.nextInt();
            while (n-- > 0) {
                char[] c = s.next().toCharArray();
                f[c[0]]++;
            }
            w.println("AC x " + f['A']);
            w.println("WA x " + f['W']);
            w.println("TLE x " + f['T']);
            w.println("RE x " + f['R']);
        }

    }

    static class FastReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private FastReader.SpaceCharFilter filter;

        public FastReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {

            if (numChars == -1)
                throw new InputMismatchException();

            if (curChar >= numChars) {

                curChar = 0;

                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }

                if (numChars <= 0)
                    return -1;
            }

            return buf[curChar++];
        }

        public int nextInt() {

            int c = read();

            while (isSpaceChar(c))
                c = read();

            int sgn = 1;

            if (c == '-') {
                sgn = -1;
                c = read();
            }

            int res = 0;

            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();

                res *= 10;
                res += c - '0';
                c = read();
            }
            while (!isSpaceChar(c));

            return res * sgn;
        }

        public String next() {

            int c = read();

            while (isSpaceChar(c))
                c = read();

            StringBuilder res = new StringBuilder();

            do {
                res.appendCodePoint(c);
                c = read();
            }
            while (!isSpaceChar(c));

            return res.toString();
        }

        public boolean isSpaceChar(int c) {

            if (filter != null)
                return filter.isSpaceChar(c);

            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}


// Utilities
import java.io.*;
import java.util.*;

public class Main {
	static int N;
	static String str;
	static int ac = 0, wa = 0, tle = 0, re = 0;

	public static void main(String[] args) throws IOException {
		N = in.iscan();
		for (int i = 0; i < N; i++) {
			str = in.sscan();
			if (str.equals("AC")) ac++;
			else if (str.equals("WA")) wa++;
			else if (str.equals("TLE")) tle++;
			else re++;
		}
		out.println("AC x " + ac);
		out.println("WA x " + wa);
		out.println("TLE x " + tle);
		out.println("RE x " + re);
		out.close();
	}

	static INPUT in = new INPUT(System.in);
	static PrintWriter out = new PrintWriter(System.out);
	private static class INPUT {

		private InputStream stream;
		private byte[] buf = new byte[1024];
		private int curChar, numChars;

		public INPUT (InputStream stream) {
			this.stream = stream;
		}

		public INPUT (String file) throws IOException {
			this.stream = new FileInputStream (file);
		}

		public int cscan () throws IOException {
			if (curChar >= numChars) {
				curChar = 0;
				numChars = stream.read (buf);
			}

			if (numChars == -1)
				return numChars;

			return buf[curChar++];
		}

		public int iscan () throws IOException {
			int c = cscan (), sgn = 1;

			while (space (c))
				c = cscan ();

			if (c == '-') {
				sgn = -1;
				c = cscan ();
			}

			int res = 0;

			do {
				res = (res << 1) + (res << 3);
				res += c - '0';
				c = cscan ();
			}
			while (!space (c));

			return res * sgn;
		}

		public String sscan () throws IOException {
			int c = cscan ();

			while (space (c))
				c = cscan ();

			StringBuilder res = new StringBuilder ();

			do {
				res.appendCodePoint (c);
				c = cscan ();
			}
			while (!space (c));

			return res.toString ();
		}

		public double dscan () throws IOException {
			int c = cscan (), sgn = 1;

			while (space (c))
				c = cscan ();

			if (c == '-') {
				sgn = -1;
				c = cscan ();
			}

			double res = 0;

			while (!space (c) && c != '.') {
				if (c == 'e' || c == 'E')
					return res * UTILITIES.fast_pow (10, iscan ());

				res *= 10;
				res += c - '0';
				c = cscan ();
			}

			if (c == '.') {
				c = cscan ();
				double m = 1;

				while (!space (c)) {
					if (c == 'e' || c == 'E')
						return res * UTILITIES.fast_pow (10, iscan ());

					m /= 10;
					res += (c - '0') * m;
					c = cscan ();
				}
			}

			return res * sgn;
		}

		public long lscan () throws IOException {
			int c = cscan (), sgn = 1;

			while (space (c))
				c = cscan ();

			if (c == '-') {
				sgn = -1;
				c = cscan ();
			}

			long res = 0;

			do {
				res = (res << 1) + (res << 3);
				res += c - '0';
				c = cscan ();
			}
			while (!space (c));

			return res * sgn;
		}

		public boolean space (int c) {
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}
	}

	public static class UTILITIES {

		static final double EPS = 10e-6;

		public static int lower_bound (int[] arr, int x) {
			int low = 0, high = arr.length, mid = -1;

			while (low < high) {
				mid = (low + high) / 2;

				if (arr[mid] >= x)
					high = mid;
				else
					low = mid + 1;
			}

			return low;
		}

		public static int upper_bound (int[] arr, int x) {
			int low = 0, high = arr.length, mid = -1;

			while (low < high) {
				mid = (low + high) / 2;

				if (arr[mid] > x)
					high = mid;
				else
					low = mid + 1;
			}

			return low;
		}

		public static int gcd (int a, int b) {
			return b == 0 ? a : gcd (b, a % b);
		}

		public static int lcm (int a, int b) {
			return a * b / gcd (a, b);
		}

		public static long fast_pow_mod (long b, long x, int mod) {
			if (x == 0) return 1;
			if (x == 1) return b;
			if (x % 2 == 0) return fast_pow_mod (b * b % mod, x / 2, mod) % mod;

			return b * fast_pow_mod (b * b % mod, x / 2, mod) % mod;
		}

		public static int fast_pow (int b, int x) {
			if (x == 0) return 1;
			if (x == 1) return b;
			if (x % 2 == 0) return fast_pow (b * b, x / 2);

			return b * fast_pow (b * b, x / 2);
		}

		public static long choose (long n, long k) {
			k = Math.min (k, n - k);
			long val = 1;

			for (int i = 0; i < k; ++i)
				val = val * (n - i) / (i + 1);

			return val;
		}

		public static long permute (int n, int k) {
			if (n < k) return 0;
			long val = 1;

			for (int i = 0; i < k; ++i)
				val = (val * (n - i));

			return val;
		}
	}
}


import java.io.*;
import java.util.*;

public class Main {
	static void solve() {
		int n = ni();
		String[] s = {"AC", "WA", "TLE", "RE"};
		int[] cnt = new int[4];
		for(int i=0;i<n;i++) {
			String t = ns();
			for(int j=0;j<4;j++) {
				if(t.equals(s[j])){
					cnt[j]++;
				}
			}
		}
		for(int i=0;i<4;i++) {
			out.println(s[i] + " x " + cnt[i]);
		}
	}

	//constant
	static final int inf = Integer.MAX_VALUE / 2;
	static final long linf = Long.MAX_VALUE / 3;
	static final double dinf = Double.MAX_VALUE / 3;
	static final long mod = (long) 1e9 + 7;
	static final int[] dx = { -1, 0, 1, 0 }, dy = { 0, -1, 0, 1 }, dx8 = { -1, -1, -1, 0, 0, 1, 1, 1 }, dy8 = { -1, 0, 1, -1, 1, -1, 0, 1 };
	static final double eps = 1e-10, pi = Math.PI;
	static StringBuilder sb = new StringBuilder();

	//libraries
	static void reverse(int ar[]) {
		int len = ar.length;
		for (int i = 0; i < len / 2; i++) {
			int t = ar[i];
			ar[i] = ar[len - 1 - i];
			ar[len - 1 - i] = t;
		}
	}
	static void reverse(long ar[]) {
		int len = ar.length;
		for (int i = 0; i < len / 2; i++) {
			long t = ar[i];
			ar[i] = ar[len - 1 - i];
			ar[len - 1 - i] = t;
		}
	}
	static void reverse(double ar[]) {
		int len = ar.length;
		for (int i = 0; i < len / 2; i++) {
			double t = ar[i];
			ar[i] = ar[len - 1 - i];
			ar[len - 1 - i] = t;
		}
	}
	static void reverse(char ar[]) {
		int len = ar.length;
		for (int i = 0; i < len / 2; i++) {
			char t = ar[i];
			ar[i] = ar[len - 1 - i];
			ar[len - 1 - i] = t;
		}
	}
	static String getReverse(String s) {
		char c[] = s.toCharArray();
		reverse(c);
		s = String.valueOf(c);
		return s;
	}
	static <T> void reverse(List<T> ls) {
		int sz = ls.size();
		for (int i = 0; i < sz / 2; i++) {
			T t = ls.get(i);
			ls.set(i, ls.get(sz - 1 - i));
			ls.set(sz - 1 - i, t);
		}
	}
	static <T> void reverse(T[] ar) {
		int len = ar.length;
		for (int i = 0; i < len / 2; i++) {
			T t = ar[i];
			ar[i] = ar[len - 1 - i];
			ar[len - 1 - i] = t;
		}
	}
	static void sbnl() {//StringBuilderに改行文字をappendする
		sb.append("\n");
	}
	static int lowerBound(int[] a, int x) {
		int l = -1, r = a.length;
		while (r - l > 1) {
			int c = (l + r) / 2;
			if (a[c] < x) {
				l = c;
			} else {
				r = c;
			}
		}
		return r;
	}
	static int upperBound(int[] a, int x) {
		int l = -1, r = a.length;
		while (r - l > 1) {
			int c = (l + r) / 2;
			if (a[c] <= x) {
				l = c;
			} else {
				r = c;
			}
		}
		return r;
	}
	static int rlowerBound(int[] a, int x) {
		int l = -1, r = a.length;
		while (r - l > 1) {
			int c = (l + r) / 2;
			if (a[c] > x) {
				l = c;
			} else {
				r = c;
			}
		}
		return r;
	}
	static int rupperBound(int[] a, int x) {
		int l = -1, r = a.length;
		while (r - l > 1) {
			int c = (l + r) / 2;
			if (a[c] >= x) {
				l = c;
			} else {
				r = c;
			}
		}
		return r;
	}
	static int lowerBound(long[] a, long x) {
		int l = -1, r = a.length;
		while (r - l > 1) {
			int c = (l + r) / 2;
			if (a[c] < x) {
				l = c;
			} else {
				r = c;
			}
		}
		return r;
	}
	static int upperBound(long[] a, long x) {
		int l = -1, r = a.length;
		while (r - l > 1) {
			int c = (l + r) / 2;
			if (a[c] <= x) {
				l = c;
			} else {
				r = c;
			}
		}
		return r;
	}
	static int rlowerBound(long[] a, long x) {
		int l = -1, r = a.length;
		while (r - l > 1) {
			int c = (l + r) / 2;
			if (a[c] > x) {
				l = c;
			} else {
				r = c;
			}
		}
		return r;
	}
	static int rupperBound(long[] a, long x) {
		int l = -1, r = a.length;
		while (r - l > 1) {
			int c = (l + r) / 2;
			if (a[c] >= x) {
				l = c;
			} else {
				r = c;
			}
		}
		return r;
	}
	static int lowerBound(double[] a, double x) {
		int l = -1, r = a.length;
		while (r - l > 1) {
			int c = (l + r) / 2;
			if (a[c] < x) {
				l = c;
			} else {
				r = c;
			}
		}
		return r;
	}
	static int upperBound(double[] a, double x) {
		int l = -1, r = a.length;
		while (r - l > 1) {
			int c = (l + r) / 2;
			if (a[c] <= x) {
				l = c;
			} else {
				r = c;
			}
		}
		return r;
	}
	static int rlowerBound(double[] a, double x) {
		int l = -1, r = a.length;
		while (r - l > 1) {
			int c = (l + r) / 2;
			if (a[c] > x) {
				l = c;
			} else {
				r = c;
			}
		}
		return r;
	}
	static int rupperBound(double[] a, double x) {
		int l = -1, r = a.length;
		while (r - l > 1) {
			int c = (l + r) / 2;
			if (a[c] >= x) {
				l = c;
			} else {
				r = c;
			}
		}
		return r;
	}
	static int lowerBound(char[] a, char x) {
		int l = -1, r = a.length;
		while (r - l > 1) {
			int c = (l + r) / 2;
			if (a[c] < x) {
				l = c;
			} else {
				r = c;
			}
		}
		return r;
	}
	static int upperBound(char[] a, char x) {
		int l = -1, r = a.length;
		while (r - l > 1) {
			int c = (l + r) / 2;
			if (a[c] <= x) {
				l = c;
			} else {
				r = c;
			}
		}
		return r;
	}
	static int rlowerBound(char[] a, char x) {
		int l = -1, r = a.length;
		while (r - l > 1) {
			int c = (l + r) / 2;
			if (a[c] > x) {
				l = c;
			} else {
				r = c;
			}
		}
		return r;
	}
	static int rupperBound(char[] a, char x) {
		int l = -1, r = a.length;
		while (r - l > 1) {
			int c = (l + r) / 2;
			if (a[c] >= x) {
				l = c;
			} else {
				r = c;
			}
		}
		return r;
	}
	static <T> int lowerBound(List<T> ls, T x) throws RuntimeException {
		if (ls.size() == 0)
			return -1;
		if (ls.get(0) instanceof Integer) {
			return ~Collections.binarySearch(ls, x, (t1, t2) -> ((Integer) t1).compareTo((Integer) t2) >= 0 ? 1 : -1);
		} else if (ls.get(0) instanceof Long) {
			return ~Collections.binarySearch(ls, x, (t1, t2) -> ((Long) t1).compareTo((Long) t2) >= 0 ? 1 : -1);
		} else if (ls.get(0) instanceof Double) {
			return ~Collections.binarySearch(ls, x, (t1, t2) -> ((Double) t1).compareTo((Double) t2) >= 0 ? 1 : -1);
		} else {
			System.err.println(
					String.format("%s:数値でないリストを二分探索しています。", Thread.currentThread().getStackTrace()[1].getMethodName()));
			throw new RuntimeException();
		}
	}
	static <T> int upperBound(List<T> ls, T x) throws RuntimeException {
		if (ls.size() == 0)
			return -1;
		if (ls.get(0) instanceof Integer) {
			return ~Collections.binarySearch(ls, x, (t1, t2) -> ((Integer) t1).compareTo((Integer) t2) > 0 ? 1 : -1);
		} else if (ls.get(0) instanceof Long) {
			return ~Collections.binarySearch(ls, x, (t1, t2) -> ((Long) t1).compareTo((Long) t2) > 0 ? 1 : -1);
		} else if (ls.get(0) instanceof Double) {
			return ~Collections.binarySearch(ls, x, (t1, t2) -> ((Double) t1).compareTo((Double) t2) > 0 ? 1 : -1);
		} else {
			System.err.println(
					String.format("%s:数値でないリストを二分探索しています。", Thread.currentThread().getStackTrace()[1].getMethodName()));
			throw new RuntimeException();
		}
	}
	static <T> int rupperBound(List<T> ls, T x) throws RuntimeException {
		if (ls.size() == 0)
			return -1;
		if (ls.get(0) instanceof Integer) {
			return ~Collections.binarySearch(ls, x, (t1, t2) -> ((Integer) t1).compareTo((Integer) t2) < 0 ? 1 : -1);
		} else if (ls.get(0) instanceof Long) {
			return ~Collections.binarySearch(ls, x, (t1, t2) -> ((Long) t1).compareTo((Long) t2) < 0 ? 1 : -1);
		} else if (ls.get(0) instanceof Double) {
			return ~Collections.binarySearch(ls, x, (t1, t2) -> ((Double) t1).compareTo((Double) t2) < 0 ? 1 : -1);
		} else {
			System.err.println(
					String.format("%s:数値でないリストを二分探索しています。", Thread.currentThread().getStackTrace()[1].getMethodName()));
			throw new RuntimeException();
		}
	}
	static <T> int rlowerBound(List<T> ls, T x) {
		if (ls.size() == 0)
			return -1;
		if (ls.get(0) instanceof Integer) {
			return ~Collections.binarySearch(ls, x, (t1, t2) -> ((Integer) t1).compareTo((Integer) t2) <= 0 ? 1 : -1);
		} else if (ls.get(0) instanceof Long) {
			return ~Collections.binarySearch(ls, x, (t1, t2) -> ((Long) t1).compareTo((Long) t2) <= 0 ? 1 : -1);
		} else if (ls.get(0) instanceof Double) {
			return ~Collections.binarySearch(ls, x, (t1, t2) -> ((Double) t1).compareTo((Double) t2) <= 0 ? 1 : -1);
		} else {
			System.err.println(
					String.format("%s:数値でないリストを二分探索しています。", Thread.currentThread().getStackTrace()[1].getMethodName()));
			throw new RuntimeException();
		}
	}
	static int[] concat(int x, int arr[]) {
		int ret[] = new int[arr.length + 1];
		System.arraycopy(arr, 0, ret, 1, ret.length - 1);
		ret[0] = x;
		return ret;
	}
	static int[] concat(int arr[], int x) {
		int ret[] = new int[arr.length + 1];
		System.arraycopy(arr, 0, ret, 0, ret.length - 1);
		ret[ret.length - 1] = x;
		return ret;
	}
	static long[] concat(long x, long arr[]) {
		long ret[] = new long[arr.length + 1];
		System.arraycopy(arr, 0, ret, 1, ret.length - 1);
		ret[0] = x;
		return ret;
	}
	static long[] concat(long arr[], long x) {
		long ret[] = new long[arr.length + 1];
		System.arraycopy(arr, 0, ret, 0, ret.length - 1);
		ret[ret.length - 1] = x;
		return ret;
	}
	static char[] concat(char x, char arr[]) {
		char ret[] = new char[arr.length + 1];
		System.arraycopy(arr, 0, ret, 0, ret.length - 1);
		ret[ret.length - 1] = x;
		return ret;
	}
	static char[] concat(char arr[], char x) {
		char ret[] = new char[arr.length + 1];
		System.arraycopy(arr, 0, ret, 0, ret.length - 1);
		ret[ret.length - 1] = x;
		return ret;
	}
	static int max(int x, int y) {
		return Math.max(x, y);
	}
	static int min(int x, int y) {
		return Math.min(x, y);
	}
	static int max(int x, int y, int z) {
		x = Math.max(x, y);
		x = Math.max(x, z);
		return x;
	}
	static int min(int x, int y, int z) {
		x = Math.min(x, y);
		x = Math.min(x, z);
		return x;
	}
	static long max(long x, long y) {
		return Math.max(x, y);
	}
	static long min(long x, long y) {
		return Math.min(x, y);
	}
	static long max(long x, long y, long z) {
		x = Math.max(x, y);
		x = Math.max(x, z);
		return x;
	}
	static long min(long x, long y, long z) {
		x = Math.min(x, y);
		x = Math.min(x, z);
		return x;
	}
	static double max(double x, double y) {
		return Math.max(x, y);
	}
	static double min(double x, double y) {
		return Math.min(x, y);
	}
	static double max(double x, double y, double z) {
		x = Math.max(x, y);
		x = Math.max(x, z);
		return x;
	}
	static double min(double x, double y, double z) {
		x = Math.min(x, y);
		x = Math.min(x, z);
		return x;
	}
	static void sort(int[] ar) {
		Arrays.sort(ar);
	}
	static void sort(long[] ar) {
		Arrays.sort(ar);
	}
	static void sort(double[] ar) {
		Arrays.sort(ar);
	}
	static void sort(char[] ar) {
		Arrays.sort(ar);
	}
	static void rsort(int[] ar) {
		Arrays.sort(ar);
		int len = ar.length;
		for (int i = 0; i < len / 2; i++) {
			int tmp = ar[i];
			ar[i] = ar[len - 1 - i];
			ar[len - 1 - i] = tmp;
		}
	}
	static void rsort(long[] ar) {
		Arrays.sort(ar);
		int len = ar.length;
		for (int i = 0; i < len / 2; i++) {
			long tmp = ar[i];
			ar[i] = ar[len - 1 - i];
			ar[len - 1 - i] = tmp;
		}
	}
	static void rsort(double[] ar) {
		Arrays.sort(ar);
		int len = ar.length;
		for (int i = 0; i < len / 2; i++) {
			double tmp = ar[i];
			ar[i] = ar[len - 1 - i];
			ar[len - 1 - i] = tmp;
		}
	}
	static void rsort(char[] ar) {
		Arrays.sort(ar);
		int len = ar.length;
		for (int i = 0; i < len / 2; i++) {
			char tmp = ar[i];
			ar[i] = ar[len - 1 - i];
			ar[len - 1 - i] = tmp;
		}
	}
	static void fill(int arr[], int x) {
		Arrays.fill(arr, x);
	}
	static void fill(long arr[], long x) {
		Arrays.fill(arr, x);
	}
	static void fill(boolean arr[], boolean x) {
		Arrays.fill(arr, x);
	}
	static void fill(double arr[], double x) {
		Arrays.fill(arr, x);
	}
	static void fill(int arr[][], int x) {
		for (int i = 0; i < arr.length; i++)
			Arrays.fill(arr[i], x);
	}
	static void fill(long arr[][], long x) {
		for (int i = 0; i < arr.length; i++)
			Arrays.fill(arr[i], x);
	}
	static void fill(double arr[][], double x) {
		for (int i = 0; i < arr.length; i++)
			Arrays.fill(arr[i], x);
	}
	static void fill(boolean arr[][], boolean x) {
		for (int i = 0; i < arr.length; i++)
			Arrays.fill(arr[i], x);
	}
	//MOD culc
	static long plus(long x, long y) {
		long res = (x + y) % mod;
		return res < 0 ? res + mod : res;
	}
	static long sub(long x, long y) {
		long res = (x - y) % mod;
		return res < 0 ? res + mod : res;
	}
	static long mul(long x, long y) {
		long res = (x * y) % mod;
		return res < 0 ? res + mod : res;
	}
	static long div(long x, long y) {
		long res = x * pow(y, mod - 2) % mod;
		return res < 0 ? res + mod : res;
	}
	static long pow(long x, long y) {
		if (y < 0)
			return 0;
		if (y == 0)
			return 1;
		if (y % 2 == 1)
			return (x * pow(x, y - 1)) % mod;
		long root = pow(x, y / 2);
		return root * root % mod;
	}
	public static void main(String[] args) throws Exception {
		is = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		out = new PrintWriter(System.out);
		solve();
		out.flush();
	}
	//input
	static InputStream is;
	static PrintWriter out;
	static String INPUT = "";
	private static byte[] inbuf = new byte[1024];
	static int lenbuf = 0, ptrbuf = 0;
	private static int readByte() {
		if (lenbuf == -1)
			throw new InputMismatchException();
		if (ptrbuf >= lenbuf) {
			ptrbuf = 0;
			try {
				lenbuf = is.read(inbuf);
			} catch (IOException e) {
				throw new InputMismatchException();
			}
			if (lenbuf <= 0)
				return -1;
		}
		return inbuf[ptrbuf++];
	}
	private static boolean isSpaceChar(int c) {
		return !(c >= 33 && c <= 126);
	}
	private static int skip() {
		int b;
		while ((b = readByte()) != -1 && isSpaceChar(b))
			;
		return b;
	}
	@SuppressWarnings("unused")
	private static double nd() {
		return Double.parseDouble(ns());
	}
	@SuppressWarnings("unused")
	private static char nc() {
		return (char) skip();
	}
	private static String ns() {
		int b = skip();
		StringBuilder sb = new StringBuilder();
		while (!(isSpaceChar(b))) {
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}
	private static char[] ns(int n) {
		char[] buf = new char[n];
		int b = skip(), p = 0;
		while (p < n && !(isSpaceChar(b))) {
			buf[p++] = (char) b;
			b = readByte();
		}
		return n == p ? buf : Arrays.copyOf(buf, p);
	}
	@SuppressWarnings("unused")
	private static char[][] nm(int n, int m) {
		char[][] map = new char[n][];
		for (int i = 0; i < n; i++)
			map[i] = ns(m);
		return map;
	}
	@SuppressWarnings("unused")
	private static int[] na(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = ni();
		return a;
	}
	@SuppressWarnings("unused")
	private static long[] nla(int n) {
		long[] a = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = nl();
		return a;
	}

	@SuppressWarnings("unused")
	private static int[][] nas(int n, int m){
		int[][] res = new int[n][m];
		for(int i=0;i<n;i++) {
			for(int j=0;j<m;j++) {
				res[i][j] = ni();
			}
		}
		return res;
	}

	@SuppressWarnings("unused")
	private static long[][] nlas(int n, int m){
		long[][] res = new long[n][m];
		for(int i=0;i<n;i++) {
			for(int j=0;j<m;j++) {
				res[i][j] = nl();
			}
		}
		return res;
	}

	@SuppressWarnings("unused")
	private static int ni() {
		int num = 0, b;
		boolean minus = false;
		while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
			;
		if (b == '-') {
			minus = true;
			b = readByte();
		}

		while (true) {
			if (b >= '0' && b <= '9') {
				num = num * 10 + (b - '0');
			} else {
				return minus ? -num : num;
			}
			b = readByte();
		}
	}
	@SuppressWarnings("unused")
	private static long nl() {
		long num = 0;
		int b;
		boolean minus = false;
		while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
			;
		if (b == '-') {
			minus = true;
			b = readByte();
		}

		while (true) {
			if (b >= '0' && b <= '9') {
				num = num * 10 + (b - '0');
			} else {
				return minus ? -num : num;
			}
			b = readByte();
		}
	}
}


import java.util.*;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int cnt = 0;
		String[] S = new String[N];
		String[] conc = {"AC", "WA", "TLE", "RE"};
      	for(int k = 0; k < N; k++){
          S[k] = sc.nextLine();
        }

		for(int i = 0; i < 4; i++){
			for(int j = 0; j < N; j++){
				if(S[j].equals(conc[i])){
					cnt++;
					System.out.println(conc[i]+" × "+cnt);
				}
			}
			cnt = 0;
		}
	}
}


import java.util.*;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int cnt = 0;
		String[] S = new String[N];
		String[] conc = {"AC", "WA", "TLE", "RE"};
      	for(int k = 0; k < N; k++){
          S[k] = sc.nextLine();
        }

		for(int i = 0; i < 4; i++){
			for(int j = 0; j < N; j++){
				if(S[j].equals(conc[i])){
					cnt++;
					System.out.println(conc[i]+"×"+cnt);
				}
			}
			cnt = 0;
		}
	}
}


import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		 Scanner sc = new Scanner(System.in);
		 int N = sc.nextInt();
		 int A = 0;
		 int W = 0;
		 int T = 0;
		 int R = 0;
		 for(int i =0; i < N; i++) {
			 String S = sc.next();
			 if(S.equals("AC")) {
				 A++;
			 }
			 else if(S.equals("WA")) {
				 W++;
			 }
			 else if(S.equals("TLE")) {
				 T++;
			 }
			 else if(S.equals("RE")) {
				 R++;
			 }
		 }
		 System.out.println("AC × " + A);
		 System.out.println("WA × " + W);
		 System.out.println("TLE × " + T);
		 System.out.println("RE × " + R);
		 sc.close();
	}
}


#pragma GCC optimize("Ofast")
#include<stdio.h>
int main(void)
{
    int n = 0;
    char c=getchar_unlocked();
    while(c<='9'&&c>='0') {n=(n<<1)+(n<<3)+c-'0'; c=getchar_unlocked();}
    int a = 0, b = 0, e = 0, d = 0;
    do
    {
        switch(getchar_unlocked())
        {
          case 'A': ++a;break;
          case 'W': ++b;break;
          case 'R': ++d;break;
          default: ++e;getchar_unlocked();
        }
        getchar_unlocked();
        getchar_unlocked();
    } while(--n);
    printf("AC x %d\nWA x %d\nTLE x %d\nRE x %d", a, b, e, d);
    return 0;
}


#include <iostream>
#include <vector>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <cstdio>
#include <bitset>
#include <queue>
#include <deque>
#include <algorithm>
#include <numeric>
#include <cassert>
#include <functional>
#include <stack>
#include <cmath>
#include <string>
#include <cstring>

using namespace std;

#define REP(i, N) for (int i = 0; i < (int)N; i++)
#define FOR(i, a, b) for (int i = a; i < (int)b; i++)
#define ALL(x) (x).begin(), (x).end()
#define INF (1 << 30)
#define LLINF (1LL << 62)
#define DEBUG(...) debug(__LINE__, ":" __VA_ARGS__)

constexpr int MOD = 1000000007;
using ll = long long;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;

inline int popcount(ll x) { return __builtin_popcountll(x); }
inline int div2num(ll x) { return __builtin_ctzll(x); }
inline bool bit(ll x, int b) { return (x >> b) & 1; }

template <class T>
string to_string(T s);
template <class S, class T>
string to_string(pair<S, T> p);
string to_string(string s) { return s; }
string to_string(const char s[]) { return to_string(string(s)); }

template <class T>
string to_string(T v) {
  if (v.empty()) return "{}";
  string ret = "{";
  for (auto x : v) ret += to_string(x) + ",";
  ret.back() = '}';
  return ret;
}

template <class S, class T>
string to_string(pair<S, T> p) {
  return "{" + to_string(p.first) + ":" + to_string(p.second) + "}";
}
void debug() { cerr << endl; }

template <class Head, class... Tail>
void debug(Head head, Tail... tail) {
  cerr << to_string(head) << " ";
  debug(tail...);
}

struct IO {
  static constexpr size_t buf_size = 1 << 20;
  char buf_in[buf_size], buf_out[buf_size];
  size_t pt_in = 0, pt_out = 0, tail_in = 0;
  char strs[10000 * 4];
  inline size_t num_digits(long long x) {
    if (x >= (long long)1e9) {
      if (x >= (long long)1e18) return 19;
      if (x >= (long long)1e17) return 18;
      if (x >= (long long)1e16) return 17;
      if (x >= (long long)1e15) return 16;
      if (x >= (long long)1e14) return 15;
      if (x >= (long long)1e13) return 14;
      if (x >= (long long)1e12) return 13;
      if (x >= (long long)1e11) return 12;
      if (x >= (long long)1e10) return 11;
      return 10;
    } else {
      if (x >= (long long)1e8) return 9;
      if (x >= (long long)1e7) return 8;
      if (x >= (long long)1e6) return 7;
      if (x >= (long long)1e5) return 6;
      if (x >= (long long)1e4) return 5;
      if (x >= (long long)1e3) return 4;
      if (x >= (long long)1e2) return 3;
      if (x >= (long long)1e1) return 2;
      return 1;
    }
  }
  IO() {
    load();
    for (int i = 0; i < 10000; ++i) {
      int j = i;
      for (int t = 3; t >= 0; --t) {
        strs[i * 4 + t] = j % 10 + '0';
        j /= 10;
      }
    }
  }
  ~IO() { flush(); }
  inline void load() {
    memcpy(buf_in, buf_in + pt_in, tail_in - pt_in);
    size_t width = tail_in - pt_in;
    tail_in = width + fread(buf_in + width, 1, buf_size - width, stdin);
    pt_in = 0;
  }
  inline void flush() {
    fwrite(buf_out, 1, pt_out, stdout);
    pt_out = 0;
  }
  inline void read(char& c) { c = buf_in[pt_in++]; }
  template <class T>
  inline void read(T& x) {
    if (pt_in + 32 > tail_in) load();
    char c;
    do {
      read(c);
    } while (c < '0');
    bool minus = 0;
    if (c == '-') {
      minus = 1;
      read(c);
    }
    x = 0;
    while (c >= '0') {
      x = x * 10 + (c & 15);
      read(c);
    }
    if (minus) x = -x;
  }
  inline void write(char c) { buf_out[pt_out++] = c; }
  template <class T>
  inline void write(T x) {
    if (pt_out > buf_size - 32) flush();
    if (x < 0) {
      write('-');
      x = -x;
    }
    size_t digits = num_digits(x);
    int i;
    for (i = pt_out + digits - 4; i > (int)pt_out; i -= 4) {
      memcpy(buf_out + i, strs + (x % 10000) * 4, 4);
      x /= 10000;
    }
    memcpy(buf_out + pt_out, strs + x * 4 + (pt_out - i), 4 + i - pt_out);
    pt_out += digits;
  }
  inline void write(const char* s) {
    if (pt_out > buf_size - 32) flush();
    for (int i = 0; s[i] != 0; ++i) write(s[i]);
  }
  template <class T>
  inline void writeln(T x) {
    write(x);
    write('\n');
  }
} io;

int main() {
  int N;
  io.read(N);
  int a = 0, b = 0, c = 0;
  REP(i, N) {
    char ch;
    io.read(ch);
    if (ch == 'T')
      c++;
    else if (ch == 'A')
      a++;
    else if (ch == 'W')
      b++;
    while (ch != '\n') io.read(ch);
  }
  io.write("AC x ");
  io.writeln(a);
  io.write("WA x ");
  io.writeln(b);
  io.write("TLE x ");
  io.writeln(c);
  io.write("RE x ");
  io.writeln(N - a - b - c);
  return 0;
}


#include <iostream>
#include <vector>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <cstdio>
#include <bitset>
#include <queue>
#include <deque>
#include <algorithm>
#include <numeric>
#include <cassert>
#include <functional>
#include <stack>
#include <cmath>
#include <string>
#include <cstring>

using namespace std;

#define REP(i, N) for (int i = 0; i < (int)N; i++)
#define FOR(i, a, b) for (int i = a; i < (int)b; i++)
#define ALL(x) (x).begin(), (x).end()
#define INF (1 << 30)
#define LLINF (1LL << 62)
#define DEBUG(...) debug(__LINE__, ":" __VA_ARGS__)

constexpr int MOD = 1000000007;
using ll = long long;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;

inline int popcount(ll x) { return __builtin_popcountll(x); }
inline int div2num(ll x) { return __builtin_ctzll(x); }
inline bool bit(ll x, int b) { return (x >> b) & 1; }

template <class T>
string to_string(T s);
template <class S, class T>
string to_string(pair<S, T> p);
string to_string(string s) { return s; }
string to_string(const char s[]) { return to_string(string(s)); }

template <class T>
string to_string(T v) {
  if (v.empty()) return "{}";
  string ret = "{";
  for (auto x : v) ret += to_string(x) + ",";
  ret.back() = '}';
  return ret;
}

template <class S, class T>
string to_string(pair<S, T> p) {
  return "{" + to_string(p.first) + ":" + to_string(p.second) + "}";
}
void debug() { cerr << endl; }

template <class Head, class... Tail>
void debug(Head head, Tail... tail) {
  cerr << to_string(head) << " ";
  debug(tail...);
}

struct IO {
  static constexpr size_t buf_size = 1 << 20;
  char buf_in[buf_size], buf_out[buf_size];
  size_t pt_in = 0, pt_out = 0, tail_in = 0;
  char strs[10000 * 4];
  inline size_t num_digits(long long x) {
    if (x >= (long long)1e9) {
      if (x >= (long long)1e18) return 19;
      if (x >= (long long)1e17) return 18;
      if (x >= (long long)1e16) return 17;
      if (x >= (long long)1e15) return 16;
      if (x >= (long long)1e14) return 15;
      if (x >= (long long)1e13) return 14;
      if (x >= (long long)1e12) return 13;
      if (x >= (long long)1e11) return 12;
      if (x >= (long long)1e10) return 11;
      return 10;
    } else {
      if (x >= (long long)1e8) return 9;
      if (x >= (long long)1e7) return 8;
      if (x >= (long long)1e6) return 7;
      if (x >= (long long)1e5) return 6;
      if (x >= (long long)1e4) return 5;
      if (x >= (long long)1e3) return 4;
      if (x >= (long long)1e2) return 3;
      if (x >= (long long)1e1) return 2;
      return 1;
    }
  }
  IO() {
    load();
    for (int i = 0; i < 10000; ++i) {
      int j = i;
      for (int t = 3; t >= 0; --t) {
        strs[i * 4 + t] = j % 10 + '0';
        j /= 10;
      }
    }
  }
  ~IO() { flush(); }
  inline void load() {
    memcpy(buf_in, buf_in + pt_in, tail_in - pt_in);
    size_t width = tail_in - pt_in;
    tail_in = width + fread(buf_in + width, 1, buf_size - width, stdin);
    pt_in = 0;
  }
  inline void flush() {
    fwrite(buf_out, 1, pt_out, stdout);
    pt_out = 0;
  }
  inline void read(char& c) { c = buf_in[pt_in++]; }
  template <class T>
  inline void read(T& x) {
    if (pt_in + 32 > tail_in) load();
    char c;
    do {
      read(c);
    } while (c < '0');
    bool minus = 0;
    if (c == '-') {
      minus = 1;
      read(c);
    }
    x = 0;
    while (c >= '0') {
      x = x * 10 + (c & 15);
      read(c);
    }
    if (minus) x = -x;
  }
  inline void write(char c) { buf_out[pt_out++] = c; }
  template <class T>
  inline void write(T x) {
    if (pt_out > buf_size - 32) flush();
    if (x < 0) {
      write('-');
      x = -x;
    }
    size_t digits = num_digits(x);
    int i;
    for (i = pt_out + digits - 4; i > (int)pt_out; i -= 4) {
      memcpy(buf_out + i, strs + (x % 10000) * 4, 4);
      x /= 10000;
    }
    memcpy(buf_out + pt_out, strs + x * 4 + (pt_out - i), 4 + i - pt_out);
    pt_out += digits;
  }
  inline void write(const char* s) {
    if (pt_out > buf_size - 32) flush();
    for (int i = 0; s[i] != 0; ++i) write(s[i]);
  }
  template <class T>
  inline void writeln(T x) {
    write(x);
    write('\n');
  }
} io;

int main() {
  int N;
  io.read(N);
  int a = 0, b = 0, c = 0;
  REP(i, N) {
    char ch;
    io.read(ch);
    if (ch == 'T') {
      c++;
      io.read(ch);
    } else if (ch == 'A')
      a++;
    else if (ch == 'W')
      b++;
    io.read(ch);
    io.read(ch);
  }
  io.write("AC x ");
  io.writeln(a);
  io.write("WA x ");
  io.writeln(b);
  io.write("TLE x ");
  io.writeln(c);
  io.write("RE x ");
  io.writeln(N - a - b - c);
  return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main(){
    int N;
    cin >> N;
    vector<string> S(N);
    int AC=0;
    int WA=0;
    int TLE=0;
    int RE=0;
    for (int i=0;i<N;i++){
        cin >> S.at(i);
        if (S.at(i)=="AC") {AC++;}
        if (S.at(i)=="WA") {WA++;}
        if (S.at(i)=="TLE") {TLE++;}
        if (S.at(i)=="RE") {RE++;}
    }// Your code here!
    cout << "AC x" << AC << endl;
    cout << "WA x" << WA << endl;
    cout << "TLE x" << TLE << endl;
    cout << "RE x" << RE << endl;
}


#include<iostream>
#include<string>
using namespace std;
int main(){
    string c;
    int n,ac=0,wa=0,tle=0,re=0;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>c;
        if(c="AC")ac++;
        if(c="WA")wa++;
        if(c="TLE")tle++;
        if(c="RE")re++;
    }
    cout<<"AC x "<<ac<<endl<<"WA x "<<wa<<endl<<"TLE x "<<tle<<endl<<"RE x "<<re<<endl;
    return 0;
}


#include<iostream>
#include<algorithm>
#include<string>

using namespace std;

int main(void) {

    int n;
    int q = 0, p = 0, e = 0,g = 0;
    string s;
    // 検索先の文字列
    string a = "A"; // 検索文字列 // AC
    string w = "W"; // WA
    string t = "T"; // TLE
    string r = "R"; // RE

    cin >> n;

    for (int i = 0; i < n; i++) {

        cin >> s;

        if (s.find_first_of("A") == 0) {

            q++;

        }

        if (s.find_first_of("W") == 0) {

            p++;

        }

        if (s.find_first_of("T") == 0) {

            e++;

        }

        if (s.find_first_of("R") == 0) {

            g++;

        }

    }

    cout << "AC × " << q << endl;
    cout << "WA × " << p << endl;
    cout << "TLE × " << e << endl;
    cout << "RE × " << g << endl;

    return 0;
}


#pragma GCC optimize("Ofast")
#include<stdio.h>
int main(void)
{
    int n = 0;
    char c=getchar_unlocked();
    while(c<='9'&&c>='0') {n=(n<<1)+(n<<3)+c-'0'; c=getchar_unlocked();}
    int a = 0, b = 0, e = 0, d = 0;
    while(--n)
    {
        switch(getchar_unlocked())
        {
          case 'A': ++a;break;
          case 'W': ++b;break;
          case 'R': ++d;break;
          default: ++e;getchar_unlocked();
        }
        getchar_unlocked();
        getchar_unlocked();
    }
        switch(getchar_unlocked())
        {
          case 'A': ++a;break;
          case 'W': ++b;break;
          case 'R': ++d;break;
          default: ++e;
        }
    printf("AC x %d\nWA x %d\nTLE x %d\nRE x %d", a, b, e, d);
    return 0;
}


#include <stdio.h>
#include <string.h>
char x[10];
int a,w,t,r;
int main(){
	int n,i;
	scanf("%d",&n);
	while(n--){
		scanf("%s",x);
		if(s[0]=='A')a++;
		else if(s[0]=='W')w++;
		else if(s[0]=='T')t++;
		else if(s[0]=='R')r++;
	}
	printf("AC x %d\n",a);
	printf("WA x %d\n",w);
	printf("TLE x %d\n",t);
	printf("RE x %d\n",r);
	return 0;
}


#include<stdio.h>
int main(void){
    int n;
    int counta = 0;
    int countw = 0;
    int countt = 0;
    int countr = 0;
    char a[5];
    scanf("%d",&n);
    for (int i = 0; i < n; i++)
    {
        scanf("%s",a);
        if (a[0] == 'A' && a[1] == 'C')
        {
            counta++;
        }
        if (a[0] == 'W' && a[1] == 'A')
        {
            countw++;
        }
        if (a[0] == 'T' && a[1] == 'L' && 'E')
        {
            countt++;
        }
        if (a[0] == 'R' && a[1] == 'E')
        {
            countr++;
        }
    }
    printf("AC * %d\n",counta);
    printf("WA * %d\n",countw);
    printf("TLE * %d\n",countt);
    printf("RE * %d\n",countr);

    return 0;
}


#include <stdio.h>

int a, AC, WA, TLE, RE;
char b[10000], A[10]=("AC"), W[10]=("WA"), T[10]=("TLE"), R[10]=("RE");

int main(){
	scanf("%d", &a);
	for(int i=0; i+1<=a; i++){
		scanf("%s", &b[i]);
	}
	for(int j=0; j+1<=a; j++){
		if(b[j]==A[0]) AC=AC+1;
		else if(b[j]==W[0]) WA=WA+1;
		else if(b[j]==T[0]) TLE=TLE+1;
		else if(b[j]==R[0]) RE=RE+1;
	}
	printf("AC x %d\nWA x %d\nTLE x %d\nRE x %d\n", AC, WA, TLE, RE);
	return 0;
}