main = getContents >>= putStrLn . solve 0 1 . map read . words

solve cnt _ (n:[]) = if n - 2 <= cnt then "YES" else "NO"
solve cnt i (n:p:ps) = if i == p
    then solve (cnt + 1) (i + 1) (n:ps)
    else solve cnt (i + 1) (n:ps)