This is overly complicated, as you can check that the sequences are of the same length as a base case of the recursion. But it works.