If there are no two consecutive 1 s , then always remove all the 1 s from array & make it sorted
if ( idx == - 1 ) { System . out . println ( " YES " ) ; return ; } for ( int i = idx + 1 ; i < N ; i ++ ) {