Moreover, when other websites link to your product, chances are some of them link to the first URL, while others link to the second URL. But if these duplicates all link to the same URL, your chance of ranking top 10 for the relevant keyword would be much higher. Canonicalization is the solution to duplicate content. You can configure the canonical URL in the advanced tab of Yoast SEO.