The present invention provides a compound having an exceptional inhibitory action on EP300 and/or CREBBP histone acetyl transferase, or a pharmaceutically acceptable salt thereof. A compound represented by formula (1) or a pharmaceutically acceptable salt thereof. (Here, ring Q1, ring Q2, R1, R2, R3, and R4 in formula (I) are each as defined in the specification).本發明係提供具有優異的EP300及/或CREBBP之組蛋白乙醯基轉移酶(histone acetyltransferase)抑制活性的化合物或其藥理上可容許的鹽。一種式(1)所表示的化合物或其藥理上可容許的鹽。(其中,式(1)中之環Q1、環Q2、R1、R2、R3、及R4係各自與說明書中的定義為同義。)