if previous count is odd , * then multiply answer by ways [ prev_count - 1 ] . * since one has already been reserved , * remaining will be even . * reduce prev_count = 0 , since we don 't need it now.
if ( prev_count & 1 ) { ans = ( ans * ways [ prev_count - 1 ] ) % mod ; count_vector [ i - 1 ] . S = 0 ; } else {