DRAM compatibility between two early 2011 MacBook Pro
Yes, the two are compatible. It doesn't matter if you have the 2720QM or 2820QM CPU.  You can swap the RAM modules without any problems.

The GPU (graphics) has no influence on which memory module is compatible. You can swap the RAM modules no matter which of the two models you have.

The 13" version will also be able to use the same RAM module.