Now, since the vector is sorted, you can start with the first element, and see whether you can double it until it equals the second element, or is greater than the second element. If greater, then the answer is "NO". If equal, then you can move on to the second element.
With the second element, you keep doubling it until it is equal to or greater than the third element.
And so on. Once again, the key step was sorting the input. This lets you know that each element is less than or equal to the next element, and you can keep doubling it. If you didn't sort, then you'd have to do more work to figure out which elements to double.