A compound of formula (I') or (I") or a pharmaceutically acceptable salt thereof, wherein m is 1 or 2; n is 2 or 3; p is 0 or 1; R 1 is C1-C6 alkyl, C1-C6 alkyl-Q-(CH 2) x, or R 1a -X-; Q is O or S; x is an integer of from 1 to 3; X is a direct bond or (CH 2) s -Y-(CH 2) t; Y is a direct bond, O or S; s is 1 or 2; t is 0 or 1; R 1a is a cyclic moiety selected from 3- to 6-membered carbocyclyl and 5- to 6-membered heterocyclyl, said cyclic moiety optionally being substituted by one or more R 1b; each R 1b is independently selected from halogen, C1-C6 alkyl, R 1c O-, R 1d C N(R 1e)-, cyano, R 1f R 1g N-, R 1h S 2 -, R 1i S-, C3-C6 carbocyclyl, and 5- to 6-membered heterocyclyl; and two R 1b attached to adjacent atoms of the cyclic moiety may form, together with the atoms to which they are attached, a 5- or 6-membered ring; each R 1e, R 1d, R 1e, R 1f, R 1g, R 1h and R 1i is independently selected from H and C1-C6 alkyl; R 2 is H or C1-C6 alkyl; R 3 is halogen; j is an integer of from 0 to 4; R 4 is C1-C3 alkyl; W is a direct bond, O, S, CR w1 R w2, or NR w3; R w1 and R w2 are independently selected from H and C1-C3 alkyl; R w3 is H or C1-C3 alkyl; v is 1 or 2; each R 5 and R 6 is independently selected from H and C1-C3 alkyl; k is an integer of from 0 to 2; each R 7 is independently selected from halogen, C1-C3 alkyl, and R 7a O; each R 7a is independently from C1-C3 alkyl; Z-R 8 is C NR 8 R 9 or NR 10 C R 8; R 8 is selected from R 8a (CR 8b R 8c) q -, R 8d O-, and C1-C6 alkyl, said alkyl optionally being substituted by a moiety selected from R 8e R 8f N- and R 8g O-; q is an integer of from 0 to 2; R 8a is a cyclic moiety selected from C3-C7 carbocyclyl and 5- to 7-membered heterocyclyl, said cyclic moiety optionally being substituted by one or more moieties selected from halogen, C1-C6 alkyl, C3-C5 cycloalkyl, and R 8h O; R 8b and R 8c are independently selected from H and C1-C3 alkyl; or R 8d is H, C1-C6 alkyl, or C3-C6 cycloalkyl; R 8e and R 8f are independently selected from H and C1-C6 alkyl; or R 8e and R 8f, together with the nitrogen atom to which they are both attached, form a 5- or 6 membered heterocyclyl optionally containing a further heteroatom in the ring; R 8g is H or C1-C6 alkyl; R 8h is H or C1-C6 alkyl; R 9 is H or C1-C6 alkyl; R 10 is H or C1-C3 alkyl; and any alkyl is saturated or unsaturated and is optionally substituted by one or more F. m is 1 or 2; n is 2 or 3; p is 0 or 1; R 1 is C1-C6 alkyl, C1-C6 alkyl-Q-(CH 2) x, or R 1a -X-; Q is O or S; x is an integer of from 1 to 3; X is a direct bond or (CH 2) s -Y-(CH 2) t; Y is a direct bond, O or S; s is 1 or 2; t is 0 or 1; R 1a is a cyclic moiety selected from 3- to 6-membered carbocyclyl and 5- to 6-membered heterocyclyl, said cyclic moiety optionally being substituted by one or more R 1b; each R 1b is independently selected from halogen, C1-C6 alkyl, R 1c O-, R 1d C N(R 1e)-, cyano, R 1f R 1g N-, R 1h S 2 -, R 1i S-, C3-C6 carbocyclyl, and 5- to 6-membered heterocyclyl; and two R 1b attached to adjacent atoms of the cyclic moiety may form, together with the atoms to which they are attached, a 5- or 6-membered ring; each R 1e, R 1d, R 1e, R 1f, R 1g, R 1h and R 1i is independently selected from H and C1-C6 alkyl; R 2 is H or C1-C6 alkyl; R 3 is halogen; j is an integer of from 0 to 4; R 4 is C1-C3 alkyl; W is a direct bond, O, S, CR w1 R w2, or NR w3; R w1 and R w2 are independently selected from H and C1-C3 alkyl; R w3 is H or C1-C3 alkyl; v is 1 or 2; each R 5 and R 6 is independently selected from H and C1-C3 alkyl; k is an integer of from 0 to 2; each R 7 is independently selected from halogen, C1-C3 alkyl, and R 7a O; each R 7a is independently from C1-C3 alkyl; Z-R 8 is C NR 8 R 9 or NR 10 C R 8; R 8 is selected from R 8a (CR 8b R 8c) q -, R 8d O-, and C1-C6 alkyl, said alkyl optionally being substituted by a moiety selected from R 8e R 8f N- and R 8g O-; q is an integer of from 0 to 2; R 8a is a cyclic moiety selected from C3-C7 carbocyclyl and 5- to 7-membered heterocyclyl, said cyclic moiety optionally being substituted by one or more moieties selected from halogen, C1-C6 alkyl, C3-C5 cycloalkyl, and R 8h O; R 8b and R 8c are independently selected from H and C1-C3 alkyl; or R 8d is H, C1-C6 alkyl, or C3-C6 cycloalkyl; R 8e and R 8f are independently selected from H and C1-C6 alkyl; or R 8e and R 8f, together with the nitrogen atom to which they are both attached, form a 5- or 6 membered heterocyclyl optionally containing a further heteroatom in the ring; R 8g is H or C1-C6 alkyl; R 8h is H or C1-C6 alkyl; R 9 is H or C1-C6 alkyl; R 10 is H or C1-C3 alkyl; and any alkyl is saturated or unsaturated and is optionally substituted by one or more F.