You are given a number 'N' and a query 'Q'. if 'Q' is 1, then you have to return the sum of all integer form 1 to 'N', else if 'Q' is equal to 2 then you have to return the product of all integer form 1 to 'N'. Since thr product can be very large, return it modulo 10 ^ 9 + 7.
for example:
Given 'N' = 4, 'Q' = 1. then the answer is 10 because the sum of all integers between 1 and 4 are 1, 2, 3 and 4. hence 1 + 2 + 3 + 4 is equal to 10.