------
## 最终结论
```python
def countArrangement(N):
    def backtrack(pos, visited):
        if pos > N:
            return 1
        count = 0
        for i in range(1, N + 1):
            if not visited[i] and (i % pos == 0 or pos % i == 0):
                visited[i] = True
                count += backtrack(pos + 1, visited)
                visited[i] = False
        return count

    visited = [False] * (N + 1)
    return backtrack(1, visited)

# Example usage:
print(countArrangement(2))  # Output: 2
```