It depends on the motherboard. If your motherboard only has 2 slots and if those 2 slots are dual channel and don't support flex mode, you can't. If there are 2 slots and they are single channel you can.
If you have 4 slots, you can, but only in single channel each, unless your motherboard supports flex mode.
If your board only supports dual channel, you can only have memory of the same capacity running together. They don't have to be the same frequency or timings.
Flex mode is the same as dual channel, but you can use different capacity memory. If you did it how you have it with 1 1GB stick and 1 512MB stick, there would be 512MB in dual channel on both sticks of memory, but the excess 512MB from the 1GB stick will be in single channel
Post up which motherboard you have, and we will be able to tell you for sure