Driver code
int main ( ) { int arr [ ] = { 2 , 4 , 8 , 6 , 9 , 12 } ; int n = sizeof ( arr ) / sizeof ( arr [ 0 ] ) ; if ( check ( arr , n ) ) cout << " Yes " << endl ; else cout << " No " << endl ; return 0 ; }