They're the same but, if you still need to check, look on the official Canon site:
https://store.canon.co.uk/ink-finder
The next time you buy a printer though, choose one which uses five (or six) separate cartridges, rather than just two. They might cost a bit more in the first instance but the inks for them usually work out far, far cheaper, resulting in big savings over the lifetime of the printer. For example, a full set of all five compatible inks for my Canon Pixma MG5750 costs just £11.78 from my favourite supplier (or as little as £9.98 if I buy in bulk). I'd be prepared to bet that you have to pay a lot more than that for a set of only two ink cartridges for your printer!