Function to check if array arr [ ] can be obtained from first N natural numbers or not
function isSequenceValid ( B , N ) { for ( let i = 0 ; i < N ; i ++ ) { if ( ( i + 1 ) % B [ i ] != 0 ) { document . write ( " " ) ; return ; } } document . write ( " " ) ; }