5. Let $N$ be a positive integer. Two players, A and B, take turns writing numbers from the set $\{1,2, \cdots, N\}$ on a blackboard. A starts and writes 1 on the blackboard. Then, if a player writes $n$ on the blackboard during their turn, their opponent can write $n+1$ or $2n$ (not exceeding $N$). The player who writes $N$ wins the game. We say $N$ is of type A (or type B) if A (or B) has a winning strategy.
(1) Is $N=2004$ of type A or type B?
(2) Find the smallest $N (N>2004)$ such that $N$ is of a different type from 2004.
5. $N$ is of type B if and only if all the digits on the odd positions in the binary representation of $N$ are 0, with the odd positions determined from right to left.

Assume that a number $n \in\{1,2, \cdots, N \mid$ is written on the blackboard at some moment. We call $n$ "winning" or "losing" based on the next player (since the player who writes 1 is player A).
Let $N=\overline{a_{k} a_{k-1} \cdots a_{1}}$ be the binary representation of $N$, then $a_{k}=1$.
Let $N_{0}=0, N_{1}=\overline{a_{k}}=1, N_{2}=\overline{a_{k} a_{k-1}}, \cdots$,
$N_{k-1}=\overline{a_{k} a_{k-1} \cdots a_{2}}, N_{k}=\overline{a_{k} a_{k-1} \cdots a_{1}}=N$,
$I_{j}=\left\{n \in \mathbf{N} \mid N_{j-1}2004$ is the smallest $N$, and makes the odd positions 048 of type B, different from 2004.