n = int(input()) n = (n - 1) % (10**9 + 7) print(n)