Consider N positive integers which are not necessarily distinct, whose sum is equal to their product and, the sum of squares of these integers is a perfect square.

Determine all the smallest value of N for which this is possible. What are the next three smallest values of N?