Provided are compounds of formula I and formula II or pharmaceuticallyacceptablesalts of the compounds and pharmaceutical compositions thereof. Thecompounds of formula I and formula 11 or the pharmaceutically acceptable saltsofthe compounds provide indole 2,3¨dioxygenase (IDO) inhibitory activity and arecapable of treating IDO¨mediated immunosuppressive diseases, such asinfectiousdiseases or cancer.(see formula I)(see formula II)