#include <iostream>
#include <vector>
#include <cstdio>
#include <algorithm>

using namespace std;

const int MOD = 1e9 + 7;

int main()
{
    freopen("victory.in", "r", stdin);
    freopen("victory.out", "w", stdout);
    int n;
    cin >> n;

    if (n * (n - 1) % 4 != 0)
    {
        cout << "0\n";
        return 0;
    }

    vector<long long> dp[2];
    int si = n * (n - 1) / 2 + 10 ;
    dp[0].resize(si);
    dp[1].resize(si);

    dp[0][0] = 1;
    for (int i = 1; i <= n; i++)
    {
        dp[1][0] = 1;
        int it = i * (i - 1) / 2 + 10;
        for (int j = 1; j < i; j++)
            dp[1][j] = dp[0][j] + dp[1][j - 1];
        for (int j = i; j < it; j++)
            dp[1][j] = MOD + dp[0][j] + dp[1][j - 1] - dp[0][j - i];
        for (int j = 0; j < it; j++)
            dp[1][j] %= MOD;
        swap(dp[1], dp[0]);
    }
    cout << dp[0][n * (n - 1) / 4] << endl;
}
