For this Question: A Tribonacci number T(n) is the sum of the preceding three elements in a series.

Calculate the value of the nth Tribonacci number modulo 1000000007. The initial three numbers of this series will be a, b and c i.e., T(1)=a, T(2)=b, T(3)=c.The only line of input contains 4 integers n, a, b, c.

Constraints
4 ≤  n ≤ 10^5
1 ≤  a, b, c ≤ 1000000000Print the result containing one integer i.e., T(n) modulo 1000000007.Input1:
5 1 2 3

Output1:
11

Input2:
4 1 1 1

Output2:
3

Explanation(might now be the optimal solution):
Input 1: 
Follow the below steps:-
T(1) = 1
T(2) = 2
T(3) = 3
T(4) = 6
T(5) = 11, I have written this Solution Code: 
import java.io.*;
import java.util.*;
class Main
  {
      static int mod = 1000000007;

	public static void main(String[] args)throws IOException {
		BufferedReader read = new BufferedReader(new InputStreamReader(System.in));
        //int t = Integer.parseInt(read.readLine());

	

            String str[] = read.readLine().trim().split(" ");
			int n = Integer.parseInt(str[0]);
			long a  =Long.parseLong(str[1]);
			long b = Long.parseLong(str[2]);
			long c = Long.parseLong(str[3]);
			
			long dp[] = new long[n];
			dp[0] = a;
			dp[1] = b;
			dp[2] = c;
			
			for(int i = 3; i < n; i++)
			{
			    dp[i] = (dp[i-1]%mod + dp[i-2]%mod + dp[i-3]%mod)%mod;
			}
			
            System.out.println(dp[n-1]);
        }
    
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?