Yes. In general, butternut squash and pumpkin are a great replacement for sweet potatoes and cook in about the same amount of time.