Check if the inverse permutation is same as the given array
for ( int i = 0 ; i < n ; i ++ ) { if ( arr [ i ] != brr [ i ] ) { Console . WriteLine ( " No " ) ; return ; } } Console . WriteLine ( " Yes " ) ; }