Yes, both. Warlords was the first expansion pack for Civilization IV, and Beyond the Sword was the second.
They stack, too — installing Beyond the Sword gives you everything from Warlords along with its own additions, so if you're only buying one, Beyond the Sword is the more complete package.