#include <stdio.h>
#import <Foundation/Foundation.h>

int main() {
  
  int N;
  scanf("%d", &N);
  
  int i;
  NSMutableArray *array = [[NSMutableArray alloc] init];
  for(i=0;i<N;i++) {
    NSInteger n;
    scanf("%ld", &n);
    [array addObject: [NSNumber numberWithInt: n]];
  }
  
  NSInteger decreaseSum = 0;
  for(i=1;i<N;i++) {
    NSNumber *current = (NSNumber *)(array[i]);
    NSNumber *prev = (NSNumber *)array[i-1];
    decreaseSum += MIN(0, [current integerValue] - [prev integerValue]);
  }
  
  printf("%s", (decreaseSum >= 2) ? "No" : "Yes");
  
  return 0;
}