how to detect a certain amount of items

i divided my players in 5 groups and every group has a different custom item. i dont want players to mix and match the items so i was wondering if it was possible to detect if someone has 2 or more of the same item (echo shard) in 2 different slots
Continue to help post