MOD = 10**9 + 7 n = input().strip() n_mod = int(n) % MOD if n_mod == 1: print(0) else: print((n_mod - 1) % MOD)