`scalarmult` is a homomorphism, so if `scalarmult(B, l)` is the identity, then `scalarmult(B, e + l) == scalarmult(B, e)`, so you can mod by `e` by `l`.