n = read_line.to_i a = [0] + read_line.split.map(&.to_i64) + [0] puts (n + 1).times.all? { |i| (a[i] - a[i + 1]).abs <= 1 } ? "Yes" : "No"