Driver code
public static void main ( String args [ ] ) { int Arr [ ] = { 3 , 2 , 1 , 1 , 4 } ; int N = Arr . length ; if ( checkIndices ( Arr , N ) ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } }