Let $A$ and $B$ be two positive integers and $A=B^2$. If $A$ satisfies the following conditions, find the value of $B$: