Consider a set $ A$ of positive integers such that the least element of $ A$ equals $ 1001$ and the product of all elements of $ A$ is a perfect square. What is the least possible value of the greatest element of $ A$?

Let's think step by step and output the final answer within \boxed{}.
user