An inhibitor of a wild type and Y641F mutant of human histone methyltransferase EZH2 is provided herein. Particularly, the inhibitor is a compound represented by formula (I) or a pharmaceutically acceptable salt thereof. The inhibitor can be used to treat a cancer or precancerous condition related to EZH2 activity.