For this Question: A message containing letters from A - Z is been encoded to numbers using the alphabetical order of the number i. e A - > 1, B - > 2,. , Z - >26. 
Given the encoded message your task is to print the number of ways the message can be decoded.Input contains a single line containing the string S.

Constraints:-
1 < = N < = 5000

Note:- String will only contains integers from 0-9Print the number of ways to decode the message.

Note: Since answer can be quite large print your answer modulo 10^9 + 7Sample Input:-
226

Sample Output:-
2

Explanation:- 
BZ VF BBF are the only possible decoded messages

Sample Input:-
102

Sample Output:-
1

Explanation:-
JB is the only possibility, I have written this Solution Code: import java.io.*;
import java.util.*;



class Main {
    public static void main (String[] args) throws IOException {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        String str=br.readLine();
        System.out.print(numDecodings(str));
    }

   static int mod = 1000000007;

    static int numDecodings(String str) {
        if (str.charAt(0) == '0') {
            return 0;
        }
        int n = str.length();
        int[] currWays = new int[n + 1];
        currWays[0] = 1;
        currWays[1] = 1;
        for (int i = 2; i <= n; i++) {
            if (str.charAt(i - 1) > '0') {
                currWays[i] = currWays[i - 1];
            }
            if (str.charAt(i - 2) == '1' || (str.charAt(i - 2) == '2' && str.charAt(i - 1) <= '6')) {
                currWays[i] = (currWays[i] + currWays[i - 2]) % mod;
            }
        }
        return currWays[n];
    }
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?