There exist positive integers $N$ and $M$ such that the remainders of $N$ when divided by the four integers $6$, $36$, $216$, and $M$ form an increasing nonzero geometric sequence in that order. Find the smallest possible value of $M$.

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