Let a + ar + ar^2 + ar^3 + \dotsb be an infinite geometric series. The sum of the series is $1.$ The sum of the squares of all the terms is $1.$ Find the common ratio.