count elements which occur more than once
for ( auto i : m ) { if ( i . second > 1 ) { if ( i . second >= 4 && i . second % 2 == 0 ) check ++ ; count ++ ; } } if ( check % 2 != 0 ) bool flag = false ; if ( check % 2 != 0 ) cout << " Yes " << endl ; else if ( n % 2 == 0 && count % 2 == 0 ) cout << " No " << endl ; else cout << " Yes " << endl ; }