Compounds represented by formula I: n n n n n n n n n n or pharmaceutically acceptable salts and solvates thereof, wherein A, B, B′, X, Y, R 1 , R 1 ′, R 2 , R 2 ′, R 3 , R 3 ′, R 5 , R 5 ′, R 6 , m, n, or p are as defined herein, are useful for treating flaviviridae viral infections.