Shimano claims that the largest cog you're supposed to use with either is 27-teeth. I've heard of people making it work by replacing the B-tension screw so they could move the RD further from the cassette. I would expect that this might compromise shift quality, though. As AEO points out, you'll also need to swap the RD if you've got the small cage version.