本發明係有關於一種如式(I)所示之咪唑啉酮及咪唑啉硫酮化合物,其中R1 、R2 、R3 、A1 、A2 ,、X、Y、Z、m、n、p、x及y如說明書所述之定義。本發明亦揭示使用該些化合物治療丙型肝炎病毒感染之方法。Imidazolidinone and imidazolidinethione compounds of formula (I):wherein R1 , R2 , R3 , A1 , A2 , X, Y, Z, m, n, p, x, and y are defined herein. Also disclosed is a method of treating hepatitis C virus infection with these compounds.