Driver code
arr = [ 1 , 7 , 6 , 4 , 5 , 3 , 2 , 8 ] NEW_LINE n = len ( arr ) NEW_LINE if ( ifPossible ( arr , n ) ) : NEW_LINE INDENT print ( " Yes " ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( " No " ) NEW_LINE DEDENT