CF28B pSort
Description
One day $ n $ cells of some array decided to play the following game. Initially each cell contains a number which is equal to it's ordinal number (starting from $ 1 $ ). Also each cell determined it's favourite number. On it's move $ i $ -th cell can exchange it's value with the value of some other $ j $ -th cell, if $ |i-j|=d_{i} $ , where $ d_{i} $ is a favourite number of $ i $ -th cell. Cells make moves in any order, the number of moves is unlimited.
The favourite number of each cell will be given to you. You will also be given a permutation of numbers from $ 1 $ to $ n $ . You are to determine whether the game could move to this state.
Input Format
N/A
Output Format
N/A