Count elements which occur more than once
for i in m . values ( ) : NEW_LINE INDENT if ( i > 1 ) : NEW_LINE INDENT if ( i >= 4 and i % 2 == 0 ) : NEW_LINE INDENT check += 1 NEW_LINE DEDENT count += 1 NEW_LINE DEDENT DEDENT if ( check % 2 != 0 ) : NEW_LINE INDENT flag = False NEW_LINE DEDENT if ( check % 2 != 0 ) : NEW_LINE INDENT print ( " Yes " ) NEW_LINE DEDENT elif ( n % 2 == 0 and count % 2 == 0 ) : NEW_LINE INDENT print ( " No " ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( " Yes " ) NEW_LINE DEDENT