Hello and welcome.
-Which exact model iMac?
-How many slots does it have?
-How many and what sizes are already installed?
You can mix sizes, but most iMac models use memory interleaving, so you want to add RAM sticks in pairs. For example, if your iMac has four slots, and the original Apple RAM occupies two slots - i.e. two 2 GB sticks, you can add a pair of 4 GB in the remaining two slots, and it will work fine. It depends on the model, number of slots, type and size of RAM sticks, etc.
C