import java.util.*;
import java.lang.*;

public class Main {
    public static void main(String args[]) {
        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();
        }
        
        boolean ans = true;
        h[0]--;
        for (int i = 1; i < n; i++) {
            if (h[i - 1] > h[i]) {
                ans = false;
                break;
            }
            if (h[i - 1] < h[i]) {
                h[i]--;
            }
        }
        System.out.println(ans?"Yes":"No");
    }
} import java.util.*; util.* java import java.lang.*; lang.* java public class Main {
    public static void main(String args[]) {
        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();
        }
        
        boolean ans = true;
        h[0]--;
        for (int i = 1; i < n; i++) {
            if (h[i - 1] > h[i]) {
                ans = false;
                break;
            }
            if (h[i - 1] < h[i]) {
                h[i]--;
            }
        }
        System.out.println(ans?"Yes":"No");
    }
} Main public static void main(String args[]) {
        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();
        }
        
        boolean ans = true;
        h[0]--;
        for (int i = 1; i < n; i++) {
            if (h[i - 1] > h[i]) {
                ans = false;
                break;
            }
            if (h[i - 1] < h[i]) {
                h[i]--;
            }
        }
        System.out.println(ans?"Yes":"No");
    } main {
        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();
        }
        
        boolean ans = true;
        h[0]--;
        for (int i = 1; i < n; i++) {
            if (h[i - 1] > h[i]) {
                ans = false;
                break;
            }
            if (h[i - 1] < h[i]) {
                h[i]--;
            }
        }
        System.out.println(ans?"Yes":"No");
    } 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] = sc.nextLong() h[i] h i sc.nextLong() sc.nextLong sc boolean ans = true; ans true h[0]-- h[0] h 0 for (int i = 1; i < n; i++) {
            if (h[i - 1] > h[i]) {
                ans = false;
                break;
            }
            if (h[i - 1] < h[i]) {
                h[i]--;
            }
        } int i = 1; int i = 1; i 1 i < n i n i++ i++ i {
            if (h[i - 1] > h[i]) {
                ans = false;
                break;
            }
            if (h[i - 1] < h[i]) {
                h[i]--;
            }
        } {
            if (h[i - 1] > h[i]) {
                ans = false;
                break;
            }
            if (h[i - 1] < h[i]) {
                h[i]--;
            }
        } if (h[i - 1] > h[i]) {
                ans = false;
                break;
            } h[i - 1] > h[i] h[i - 1] h i - 1 i 1 h[i] h i {
                ans = false;
                break;
            } ans = false ans false break; if (h[i - 1] < h[i]) {
                h[i]--;
            } h[i - 1] < h[i] h[i - 1] h i - 1 i 1 h[i] h i {
                h[i]--;
            } h[i]-- h[i] h i System.out.println(ans?"Yes":"No") System.out.println System.out System System.out ans?"Yes":"No" ans "Yes" "No" String args[] args public class Main {
    public static void main(String args[]) {
        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();
        }
        
        boolean ans = true;
        h[0]--;
        for (int i = 1; i < n; i++) {
            if (h[i - 1] > h[i]) {
                ans = false;
                break;
            }
            if (h[i - 1] < h[i]) {
                h[i]--;
            }
        }
        System.out.println(ans?"Yes":"No");
    }
} public class Main {
    public static void main(String args[]) {
        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();
        }
        
        boolean ans = true;
        h[0]--;
        for (int i = 1; i < n; i++) {
            if (h[i - 1] > h[i]) {
                ans = false;
                break;
            }
            if (h[i - 1] < h[i]) {
                h[i]--;
            }
        }
        System.out.println(ans?"Yes":"No");
    }
} Main
import java.util.*;
import java.lang.*;

public class Main {
    public static void main(String args[]) {
        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();
        }
        
        boolean ans = true;
        h[0]--;
        for (int i = 1; i < n; i++) {
            if (h[i - 1] > h[i]) {
                ans = false;
                break;
            }
            if (h[i - 1] < h[i]) {
                h[i]--;
            }
        }
        System.out.println(ans?"Yes":"No");
    }
}