import sys input = sys.stdin.readline inp = input() if len(inp) > 10 ** 5: print(0) exit(0) N = int(inp) mod = 10 ** 9 + 7 print((N - 1) % mod)