(1) Except as authorised under the regulations, no person shall produce a substance included in Schedule I, II, III, or IV.   (2) Every person who contravenes subsection (1) (a) If the subject matter of the offence is a substance included in Schedule I, is guilty of an indictable offence and liable to imprisonment for life and to a minimum punishment of imprisonment for a term of three years if any of the factors set out in subsection (3) apply and for a term of two years in any other case; (a.1) if the subject matter of the offence is a substance included in Schedule II, other than cannabis (marijuana), is guilty of an indictable offence and liable to imprisonment for life, and to a minimum punishment of imprisonment (i) for a term of one year if the production is for the purpose of trafficking, or and any of the factors set out in subsection (3) apply;   (b) if the subject matter of the offence is cannabis (marijuana), is guilty of an indictable offence and liable to  imprisonment for a term of not more than 14 years, and to a minimum punishment of (i) imprisonment for a term of six months if the number of plants produced is less than 201 and more than five, and the production is for the purpose of trafficking, (ii) imprisonment for a term of nine months if the number of plants produced is less than 201 and more than five, the production is for the purpose of trafficking and any of the factors set out in subsection (3) apply, (iii) imprisonment for a term of one year if the number of plants produced is more than 200 and less than 501, (iv) imprisonment for a term of 18 months if the number of plants produced is more than 200 and less than 501 and any of the factors set out in subsection (3) apply, (v) imprisonment for a term of two years if the number of plants produced is more than 500, or (vi) imprisonment for a term of three years if the number of plants produced is more than 500 and any of the factors set out in subsection (3) apply;   (c) where the subject-matter of the offence is a substance included in Schedule III, (i) is guilty of an indictable offence and liable to imprisonment for a term not exceeding ten years, or (ii) is guilty of an offence punishable on summary conviction and liable to imprisonment for a term not exceeding eighteen months; and (d) where the subject-matter of the offence is a substance included in Schedule IV, (i) is guilty of an indictable offence and liable to imprisonment for a term not exceeding three years, or (ii) is guilty of an offence punishable on summary conviction and liable to imprisonment for a term not exceeding one year.   (3) The following factors must be taken into account in applying paragraphs (2)(a) to (b): (a) the person used real property that belongs to a third party in committing the offence; (b) the production constituted a potential security, health or safety hazard to persons under the age of 18 years who were in the location where the offence was committed or in the immediate area; (c) the production constituted a potential public safety hazard in a residential area; or (d) the person set or placed a trap, device or other thing that is likely to cause death or bodily harm to another person in the location where the offence was committed or in the immediate area, permitted such a trap, device or other thing to remain or be placed in that location or area.