import java.util.Scanner; public class Main{ public static long fib(long n) { if(n == 0){ return 0; } return fib(n-1)+n; } public static void main(String[] args){ Scanner s = new Scanner(System.in); long n = Long.parseLong(s.next()); long fib1 = fib(n); long fib2 = fib(fib1); long ans = fib2 % (((long) Math.pow(10, 9)) + 7); System.out.println(ans); s.close(); } }