Romans 5:13 shows us that before the Law [the Law of Moses] was given, sin was in the world, but sin is not imputed where there is no Law.
The word 'impute' means to take what has been done and apply it to one's account or to hold transgressions against them.
Sin was not held against people until God gave the Law of Moses.