'use strict'

const main = input => {
	const args = input.split('\n').map(arg => arg.split(' '))
	const N = parseInt(args[0][0], 10)
	const H = args[1].map(arg => parseInt(arg, 10))
	let ans = true
	let cur = H[0]

	for (let i = 0; i < N - 1; i++) {
		if (H[i + 1] - 1 >= cur) {
			cur = H[i + 1] - 1
		} else if (H[i + 1] >= cur) {
			cur = H[i + 1]
		} else {
			ans = false
		}
	}

	if (ans) console.log('Yes')
	else console.log('No')
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'))
