def solve(a) return a.each_with_index.all? {|i, j| i <= j + 1} end n = gets.to_i a = gets.split.map &:to_i puts solve(a) || solve(a.reverse) ? "Yes" : "No"