I want to write a thank you note with the following sentence:

Thank you for inviting me and Sam to your birthday party.

Or is it

Thank you for inviting Sam and me to your birthday party.