Driver code
public static void main ( String args [ ] ) { int arr [ ] = { 2 , 1 , 3 , 5 , 12 , 11 , 7 , 9 } ; int N = arr . length ; int L = 2 ; int R = 6 ; if ( hasCrest ( arr , N , L , R ) ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } }