(You may cast a legendary sorcery only if you control a legendary creature or planeswalker.)
Exile all nonland permanents that aren’t legendary.