import java.util.*;

public class Main {

    public static void main(String[] args) {
        //Compute c1 = new Compute();//calc

        long count = 0;
        boolean sw = false;
        int max = Integer.MIN_VALUE;
        int min = Integer.MAX_VALUE;
        double dMax = Double.MIN_VALUE;
        double dMin = Double.MAX_VALUE;
        //StringBuilder answer=new StringBuilder();

        //input
        Scanner sc = new Scanner(System.in);
        int n=sc.nextInt();
        long h[] = new long[n];
        for (int i=0;i<n;++i) h[i]=sc.nextLong();

        String ans[]={"Yes","No"};
        int ansInd=0;

        for (int i=n-1;i>0;--i)
        {
            long h1=h[i];
            long h2=h[i-1];

            if (h1>=h2) continue;

            long h3=h2-1;
            if (h1<h3)
            {
                ansInd=1;
                break;
            }else
            {
                h[i-1]=h3;
                continue;
            }
        }
        System.out.println(ans[ansInd]);
        //output
        //System.out.println(String.format("%.0f",answer));
    }
} import java.util.*; util.* java public class Main {

    public static void main(String[] args) {
        //Compute c1 = new Compute();//calc

        long count = 0;
        boolean sw = false;
        int max = Integer.MIN_VALUE;
        int min = Integer.MAX_VALUE;
        double dMax = Double.MIN_VALUE;
        double dMin = Double.MAX_VALUE;
        //StringBuilder answer=new StringBuilder();

        //input
        Scanner sc = new Scanner(System.in);
        int n=sc.nextInt();
        long h[] = new long[n];
        for (int i=0;i<n;++i) h[i]=sc.nextLong();

        String ans[]={"Yes","No"};
        int ansInd=0;

        for (int i=n-1;i>0;--i)
        {
            long h1=h[i];
            long h2=h[i-1];

            if (h1>=h2) continue;

            long h3=h2-1;
            if (h1<h3)
            {
                ansInd=1;
                break;
            }else
            {
                h[i-1]=h3;
                continue;
            }
        }
        System.out.println(ans[ansInd]);
        //output
        //System.out.println(String.format("%.0f",answer));
    }
} Main public static void main(String[] args) {
        //Compute c1 = new Compute();//calc

        long count = 0;
        boolean sw = false;
        int max = Integer.MIN_VALUE;
        int min = Integer.MAX_VALUE;
        double dMax = Double.MIN_VALUE;
        double dMin = Double.MAX_VALUE;
        //StringBuilder answer=new StringBuilder();

        //input
        Scanner sc = new Scanner(System.in);
        int n=sc.nextInt();
        long h[] = new long[n];
        for (int i=0;i<n;++i) h[i]=sc.nextLong();

        String ans[]={"Yes","No"};
        int ansInd=0;

        for (int i=n-1;i>0;--i)
        {
            long h1=h[i];
            long h2=h[i-1];

            if (h1>=h2) continue;

            long h3=h2-1;
            if (h1<h3)
            {
                ansInd=1;
                break;
            }else
            {
                h[i-1]=h3;
                continue;
            }
        }
        System.out.println(ans[ansInd]);
        //output
        //System.out.println(String.format("%.0f",answer));
    } main {
        //Compute c1 = new Compute();//calc

        long count = 0;
        boolean sw = false;
        int max = Integer.MIN_VALUE;
        int min = Integer.MAX_VALUE;
        double dMax = Double.MIN_VALUE;
        double dMin = Double.MAX_VALUE;
        //StringBuilder answer=new StringBuilder();

        //input
        Scanner sc = new Scanner(System.in);
        int n=sc.nextInt();
        long h[] = new long[n];
        for (int i=0;i<n;++i) h[i]=sc.nextLong();

        String ans[]={"Yes","No"};
        int ansInd=0;

        for (int i=n-1;i>0;--i)
        {
            long h1=h[i];
            long h2=h[i-1];

            if (h1>=h2) continue;

            long h3=h2-1;
            if (h1<h3)
            {
                ansInd=1;
                break;
            }else
            {
                h[i-1]=h3;
                continue;
            }
        }
        System.out.println(ans[ansInd]);
        //output
        //System.out.println(String.format("%.0f",answer));
    } long count = 0; count 0 boolean sw = false; sw false int max = Integer.MIN_VALUE; max Integer.MIN_VALUE Integer Integer.MIN_VALUE int min = Integer.MAX_VALUE; min Integer.MAX_VALUE Integer Integer.MAX_VALUE double dMax = Double.MIN_VALUE; dMax Double.MIN_VALUE Double Double.MIN_VALUE double dMin = Double.MAX_VALUE; dMin Double.MAX_VALUE Double Double.MAX_VALUE Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n=sc.nextInt(); n sc.nextInt() sc.nextInt sc long h[] = new long[n]; h new long[n] n for (int i=0;i<n;++i) h[i]=sc.nextLong(); int i=0; int i=0; i 0 i<n i n ++i ++i i h[i]=sc.nextLong(); h[i]=sc.nextLong() h[i] h i sc.nextLong() sc.nextLong sc String ans[]={"Yes","No"}; ans {"Yes","No"} "Yes" "No" int ansInd=0; ansInd 0 for (int i=n-1;i>0;--i)
        {
            long h1=h[i];
            long h2=h[i-1];

            if (h1>=h2) continue;

            long h3=h2-1;
            if (h1<h3)
            {
                ansInd=1;
                break;
            }else
            {
                h[i-1]=h3;
                continue;
            }
        } int i=n-1; int i=n-1; i n-1 n 1 i>0 i 0 --i --i i {
            long h1=h[i];
            long h2=h[i-1];

            if (h1>=h2) continue;

            long h3=h2-1;
            if (h1<h3)
            {
                ansInd=1;
                break;
            }else
            {
                h[i-1]=h3;
                continue;
            }
        } {
            long h1=h[i];
            long h2=h[i-1];

            if (h1>=h2) continue;

            long h3=h2-1;
            if (h1<h3)
            {
                ansInd=1;
                break;
            }else
            {
                h[i-1]=h3;
                continue;
            }
        } long h1=h[i]; h1 h[i] h i long h2=h[i-1]; h2 h[i-1] h i-1 i 1 if (h1>=h2) continue; h1>=h2 h1 h2 continue; long h3=h2-1; h3 h2-1 h2 1 if (h1<h3)
            {
                ansInd=1;
                break;
            }else
            {
                h[i-1]=h3;
                continue;
            } h1<h3 h1 h3 {
                ansInd=1;
                break;
            } ansInd=1 ansInd 1 break; {
                h[i-1]=h3;
                continue;
            } h[i-1]=h3 h[i-1] h i-1 i 1 h3 continue; System.out.println(ans[ansInd]) System.out.println System.out System System.out ans[ansInd] ans ansInd String[] args args public class Main {

    public static void main(String[] args) {
        //Compute c1 = new Compute();//calc

        long count = 0;
        boolean sw = false;
        int max = Integer.MIN_VALUE;
        int min = Integer.MAX_VALUE;
        double dMax = Double.MIN_VALUE;
        double dMin = Double.MAX_VALUE;
        //StringBuilder answer=new StringBuilder();

        //input
        Scanner sc = new Scanner(System.in);
        int n=sc.nextInt();
        long h[] = new long[n];
        for (int i=0;i<n;++i) h[i]=sc.nextLong();

        String ans[]={"Yes","No"};
        int ansInd=0;

        for (int i=n-1;i>0;--i)
        {
            long h1=h[i];
            long h2=h[i-1];

            if (h1>=h2) continue;

            long h3=h2-1;
            if (h1<h3)
            {
                ansInd=1;
                break;
            }else
            {
                h[i-1]=h3;
                continue;
            }
        }
        System.out.println(ans[ansInd]);
        //output
        //System.out.println(String.format("%.0f",answer));
    }
} public class Main {

    public static void main(String[] args) {
        //Compute c1 = new Compute();//calc

        long count = 0;
        boolean sw = false;
        int max = Integer.MIN_VALUE;
        int min = Integer.MAX_VALUE;
        double dMax = Double.MIN_VALUE;
        double dMin = Double.MAX_VALUE;
        //StringBuilder answer=new StringBuilder();

        //input
        Scanner sc = new Scanner(System.in);
        int n=sc.nextInt();
        long h[] = new long[n];
        for (int i=0;i<n;++i) h[i]=sc.nextLong();

        String ans[]={"Yes","No"};
        int ansInd=0;

        for (int i=n-1;i>0;--i)
        {
            long h1=h[i];
            long h2=h[i-1];

            if (h1>=h2) continue;

            long h3=h2-1;
            if (h1<h3)
            {
                ansInd=1;
                break;
            }else
            {
                h[i-1]=h3;
                continue;
            }
        }
        System.out.println(ans[ansInd]);
        //output
        //System.out.println(String.format("%.0f",answer));
    }
} Main
import java.util.*;

public class Main {

    public static void main(String[] args) {
        //Compute c1 = new Compute();//calc

        long count = 0;
        boolean sw = false;
        int max = Integer.MIN_VALUE;
        int min = Integer.MAX_VALUE;
        double dMax = Double.MIN_VALUE;
        double dMin = Double.MAX_VALUE;
        //StringBuilder answer=new StringBuilder();

        //input
        Scanner sc = new Scanner(System.in);
        int n=sc.nextInt();
        long h[] = new long[n];
        for (int i=0;i<n;++i) h[i]=sc.nextLong();

        String ans[]={"Yes","No"};
        int ansInd=0;

        for (int i=n-1;i>0;--i)
        {
            long h1=h[i];
            long h2=h[i-1];

            if (h1>=h2) continue;

            long h3=h2-1;
            if (h1<h3)
            {
                ansInd=1;
                break;
            }else
            {
                h[i-1]=h3;
                continue;
            }
        }
        System.out.println(ans[ansInd]);
        //output
        //System.out.println(String.format("%.0f",answer));
    }
}