Stone Division

Two players, First and Second, sit in front of a single pile of n stones. First moves first. A set S = {s[0], s[1], ..., s[k-1]} of k distinct integers describes the legal splits.

The players alternate turns. On a turn, a player picks some s[i] from S and splits one of the piles currently on the table into exactly s[i] smaller piles of equal size. A split is legal only when the pile size is divisible by s[i]. Every resulting pile stays on the table and can be split again on a later turn. If no s[i] can split any of the available piles into s[i] equal parts, the player whose turn it is loses. Both players play optimally.

Return true if First wins, and false if Second wins.

How the numbers are passed

The official bounds allow values up to 10^18, which no double can represent exactly. The starting pile n and every element of s therefore arrive as base-10 strings without leading zeros, for example "1000000000000000000", and s is an array of such strings. The mathematical objects are still the integers of the constraints below; the strings are only the transport format. Parse them exactly (BigInt, Python int, long long, int64) and never round them through a float.

Examples
Input: ["6",["2","3"]]
Output: true
Hints
Related Problems

Stone Division

Two players, *First* and *Second*, sit in front of a single pile of `n` stones. *First* moves first. A set `S = {s[0], s[1], ..., s[k-1]}` of `k` distinct integers describes the legal splits.