PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#QHD0000044. Chia hai tập II (Two Sets II)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Chia hai tập II (Two Sets II)

Two Sets II

Source: CSES

Version: Phuoc Hung OJ Extended

Problem Statement

Consider the set {1,2,…,n}\{1,2,\ldots,n\}. Partition all elements into two disjoint subsets having equal sums. Swapping the two subsets does not produce a different partition. Count the number of distinct partitions modulo 109+710^9+7.

Input

One line contains integer nn.

Output

Print the number of partitions modulo 109+710^9+7.

Subtasks

The independent scoring groups have the following complete constraints:

  • Subtask 1 (20%): 1≤n≤161\le n\le16.
  • Subtask 2 (30%): 1≤n≤1001\le n\le100.
  • Subtask 3 (50%): 1≤n≤5001\le n\le500.

Examples

Input

7

Output

4

Explanation

The total sum from 11 to 77 is 2828, so both groups must sum to 1414. There are exactly 44 unordered partitions.