This is a classic situation where we have to find the maximum number of straight cuts possible on a cake which is termed as combinatorial geometry.
def max_pieces(n): MOD=1000000007 return(N*(N+1)//2+1)%MOD
N=int(input()) print(max_pieces(N))
OUTPUT:
print(max_pieces(7))
29