bzoj#P3209. [花神] 数论题(二进制1的个数之积)

[花神] 数论题(二进制1的个数之积)

题目描述

记 popcount⁡(x)\operatorname{popcount}(x) 为 xx 的二进制表示中 11 的个数。

求

∏i=1npopcount⁡(i)\prod_{i=1}^{n} \operatorname{popcount}(i)

的值对 1000000710000007 取模的结果。

输入格式

一行一个整数 nn(1≤n≤10181\le n\le 10^{18})。

输出格式

一行一个整数表示答案。

样例输入

5

样例输出

4