Let $A$ and $B$ be sets such that there are exactly $144$ sets which are subsets of either $A$ or $B$. Determine the number of elements $A \cup B$ has.

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