The present inventon provides the following compounds having anti-viral activity.A1is CR1AR1B, S or O; A2is CR2AR2B, S or O; A3is CR3AR3B, S or O; A4is CR4AR4B, S or O; the number of hetero atoms among atoms constituting the ring which consists of A1, A2, A3, A4, nitrogen atom adjacent to A1and carbon atom adjacent to A1, is 1 or 2; R1Aand R1Bare each independently hydrogen, halogen, alkyl, or the like; R2Aand R2Bare each independently hydrogen, halogen, alkyl, or the like; R3Aand R3Bare each independently hydrogen, halogen, alkyl, or the like; R4Aand R4Bare each independently hydrogen, halogen, alkyl, or the like; R3Aand R3Bmay be taken together to form non-aromatic carbocycle or non-aromatic heterocycle; X is CH2, S or O; R1is each independently halogen, hydroxy, or the like; m is any integer of 0 to 2; and n is any integer of 1 to 2.本發明提供一種具有抗病毒作用之以下之化合物: A1為CR1AR1B、S或O; A2為CR2AR2B、S或O; A3為CR3AR3B、S或O; A4為CR4AR4B、S或O; 此處,由A1、A2、A3、A4、與A1鄰接之氮原子、及與A4鄰接之碳原子所構成之成環原子之雜原子之數為1個或2個; R1A及R1B分別獨立為氫、鹵素、或烷基等; R2A及R2B分別獨立為氫、鹵素、或烷基等; R3A及R3B分別獨立為氫、鹵素、或烷基等; R4A及R4B分別獨立為氫、鹵素、或烷基等; R3A及R3B可一起形成非芳香族碳環或非芳香族雜環; X為CH2、S或O; R1分別獨立為鹵素或羥基等; m為0~2之整數; n為1~2之整數)。