Driver code
public static void main ( String [ ] args ) throws java . lang . Exception { int arr [ ] = { 1 , 0 , 2 , 3 , 7 } ; if ( check ( arr ) ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } }