The present invention is directed to modulators of indoleamine 2,3-dioxygenase(IDO), as wellas compositions and pharmaceutical methods thereof. In one embodiment, theinvention relatesto a compound:(see above formula)wherein X1, X2, W, R2, R3a, R3b, R5, R5b, a, b, m, n and p are defined in thespecification, or apharmaceutically acceptable salt thereof.