Two players $A$ and $B$ take turns taking stones from a pile of $N$ stones. They play in the order $A$, $B$, $A$, $B$, $A$, $....$, $A$ starts the game and the one who takes out the last stone loses.$ B$ can serve on each play $1$, $2$ or 3 stones, while$ A$ can draw $2, 3, 4$ stones or $1$ stone in each turn f it is the last one in the pile. Determine for what values of $N$ does $A$ have a winning strategy, and for what values the winning strategy is $B$'s.