For this Question: A string is called beautiful if it can be represented by two or more consecutive numbers. Given a string S check if it is beautiful or not.

Note:- The numbers should not contain leading zeroes in it i. e string "10203" ("1" + "02" + "03") will not be treated as a beautiful stringInput contains a single string containing the string S.

Constraints:-
1 <= |S| <= 32Print "YES" if the given string is beautiful and print the first number of the sequence else print "NO".Sample Input:-
101112

Sample Output:-
YES 10

Explanation:-
Given string can be broken as "10" + "11" + "12"

Sample Input:-
101111

Sample Output:-
NO, 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 in = br.readLine().trim();
		boolean printed = false;
		for(int i = 1; i <= (in.length() / 2); i++) {
			ArrayList<Long> valueArray = new ArrayList<>();
			boolean incremented = false;
			int len = i;
			for(int j = 0; j < in.length(); ) {
				String temp = in.substring(j, Math.min((len+j), in.length()));
				valueArray.add(Long.parseLong(temp));

					j+=len;
				if(Long.parseLong(temp) % 10 == 9) {
					int digits = findLength(Long.parseLong(temp));
					if(Long.parseLong(temp) % ((long)Math.pow(10, digits) - 1) == 0)
						++len;
					incremented = true;
				}

			}
			long[] arrli = new long[valueArray.size()];
			for(int k = 0; k < valueArray.size(); k++) {
				arrli[k] = valueArray.get(k);
			}

			if(incremented) {
				--len;
			}

			if(isBeauty(arrli)) {
				System.out.println("YES " + arrli[0]);
				printed = true;
				break;
			}
		}
		if(!printed)
			System.out.println("NO");
	}

	public static int findLength(long n) {
		int count = 0;
		while(n > 0) {
			n /= 10;
			++count;
		}
		return count;
	}

	public static boolean isBeauty(long[] tempOne) {
		for(int i = 1; i < tempOne.length; i++) {
			if(tempOne[i-1] + 1 != tempOne[i])
				return false;
		}
		return true;
	}
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?