import java.util.Scanner;

/**
 * https://atcoder.jp/contests/abc136/tasks/abc136_c
 */
public class Main {

  private static void answer(long[] hs) {
    if (hs.length <= 1) {
      System.out.println("Yes");
      return;
    }
    
    long prev = hs[0] - 1;
    for (int i = 1; i < hs.length; i++) {
      long h = hs[i];
      if (prev < h) {
        prev = h - 1;
      }
      
      if (prev > h) {
        System.out.println("No");
        return;
      }
    }

    System.out.println("Yes");
  }

  public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    int n = scan.nextInt();
    long[] hs = new long[n];
    for (int i = 0; i < n; i++) {
      hs[i] = scan.nextLong();
    }
    scan.close();

    answer(hs);
  }
} import java.util.Scanner; Scanner java.util public class Main {

  private static void answer(long[] hs) {
    if (hs.length <= 1) {
      System.out.println("Yes");
      return;
    }
    
    long prev = hs[0] - 1;
    for (int i = 1; i < hs.length; i++) {
      long h = hs[i];
      if (prev < h) {
        prev = h - 1;
      }
      
      if (prev > h) {
        System.out.println("No");
        return;
      }
    }

    System.out.println("Yes");
  }

  public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    int n = scan.nextInt();
    long[] hs = new long[n];
    for (int i = 0; i < n; i++) {
      hs[i] = scan.nextLong();
    }
    scan.close();

    answer(hs);
  }
} Main private static void answer(long[] hs) {
    if (hs.length <= 1) {
      System.out.println("Yes");
      return;
    }
    
    long prev = hs[0] - 1;
    for (int i = 1; i < hs.length; i++) {
      long h = hs[i];
      if (prev < h) {
        prev = h - 1;
      }
      
      if (prev > h) {
        System.out.println("No");
        return;
      }
    }

    System.out.println("Yes");
  } answer {
    if (hs.length <= 1) {
      System.out.println("Yes");
      return;
    }
    
    long prev = hs[0] - 1;
    for (int i = 1; i < hs.length; i++) {
      long h = hs[i];
      if (prev < h) {
        prev = h - 1;
      }
      
      if (prev > h) {
        System.out.println("No");
        return;
      }
    }

    System.out.println("Yes");
  } if (hs.length <= 1) {
      System.out.println("Yes");
      return;
    } hs.length <= 1 hs.length hs hs.length 1 {
      System.out.println("Yes");
      return;
    } System.out.println("Yes") System.out.println System.out System System.out "Yes" return; long prev = hs[0] - 1; prev hs[0] - 1 hs[0] hs 0 1 for (int i = 1; i < hs.length; i++) {
      long h = hs[i];
      if (prev < h) {
        prev = h - 1;
      }
      
      if (prev > h) {
        System.out.println("No");
        return;
      }
    } int i = 1; int i = 1; i 1 i < hs.length i hs.length hs hs.length i++ i++ i {
      long h = hs[i];
      if (prev < h) {
        prev = h - 1;
      }
      
      if (prev > h) {
        System.out.println("No");
        return;
      }
    } {
      long h = hs[i];
      if (prev < h) {
        prev = h - 1;
      }
      
      if (prev > h) {
        System.out.println("No");
        return;
      }
    } long h = hs[i]; h hs[i] hs i if (prev < h) {
        prev = h - 1;
      } prev < h prev h {
        prev = h - 1;
      } prev = h - 1 prev h - 1 h 1 if (prev > h) {
        System.out.println("No");
        return;
      } prev > h prev h {
        System.out.println("No");
        return;
      } System.out.println("No") System.out.println System.out System System.out "No" return; System.out.println("Yes") System.out.println System.out System System.out "Yes" long[] hs hs public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    int n = scan.nextInt();
    long[] hs = new long[n];
    for (int i = 0; i < n; i++) {
      hs[i] = scan.nextLong();
    }
    scan.close();

    answer(hs);
  } main {
    Scanner scan = new Scanner(System.in);
    int n = scan.nextInt();
    long[] hs = new long[n];
    for (int i = 0; i < n; i++) {
      hs[i] = scan.nextLong();
    }
    scan.close();

    answer(hs);
  } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan long[] hs = new long[n]; hs new long[n] n for (int i = 0; i < n; i++) {
      hs[i] = scan.nextLong();
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      hs[i] = scan.nextLong();
    } {
      hs[i] = scan.nextLong();
    } hs[i] = scan.nextLong() hs[i] hs i scan.nextLong() scan.nextLong scan scan.close() scan.close scan answer(hs) answer hs String[] args args public class Main {

  private static void answer(long[] hs) {
    if (hs.length <= 1) {
      System.out.println("Yes");
      return;
    }
    
    long prev = hs[0] - 1;
    for (int i = 1; i < hs.length; i++) {
      long h = hs[i];
      if (prev < h) {
        prev = h - 1;
      }
      
      if (prev > h) {
        System.out.println("No");
        return;
      }
    }

    System.out.println("Yes");
  }

  public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    int n = scan.nextInt();
    long[] hs = new long[n];
    for (int i = 0; i < n; i++) {
      hs[i] = scan.nextLong();
    }
    scan.close();

    answer(hs);
  }
} public class Main {

  private static void answer(long[] hs) {
    if (hs.length <= 1) {
      System.out.println("Yes");
      return;
    }
    
    long prev = hs[0] - 1;
    for (int i = 1; i < hs.length; i++) {
      long h = hs[i];
      if (prev < h) {
        prev = h - 1;
      }
      
      if (prev > h) {
        System.out.println("No");
        return;
      }
    }

    System.out.println("Yes");
  }

  public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    int n = scan.nextInt();
    long[] hs = new long[n];
    for (int i = 0; i < n; i++) {
      hs[i] = scan.nextLong();
    }
    scan.close();

    answer(hs);
  }
} Main
import java.util.Scanner;

/**
 * https://atcoder.jp/contests/abc136/tasks/abc136_c
 */
public class Main {

  private static void answer(long[] hs) {
    if (hs.length <= 1) {
      System.out.println("Yes");
      return;
    }
    
    long prev = hs[0] - 1;
    for (int i = 1; i < hs.length; i++) {
      long h = hs[i];
      if (prev < h) {
        prev = h - 1;
      }
      
      if (prev > h) {
        System.out.println("No");
        return;
      }
    }

    System.out.println("Yes");
  }

  public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    int n = scan.nextInt();
    long[] hs = new long[n];
    for (int i = 0; i < n; i++) {
      hs[i] = scan.nextLong();
    }
    scan.close();

    answer(hs);
  }
}
