A person commits an offence if—
he is a trespasser on any premises,
he intends to commit a relevant sexual offence on the premises, and
he knows that, or is reckless as to whether, he is a trespasser.
In this section—
A person guilty of an offence under this section is liable—
on summary conviction, to imprisonment for a term not exceeding 6 months or a fine not exceeding the statutory maximum or both;
on conviction on indictment, to imprisonment for a term not exceeding 10 years.