Actually, a sin can only exist in conjunction with a law. Example....you can't break a speed limit and "sin" if there is no speed limit law.
That's why God gave man the law, so they would recognize sin, and in so doing recognize their inability to stop sinning , be perfect on their own. This would in turn lead them to know they needed a savior. Since they couldn't keep the law on their own they had to trust in the savior.