For this Question: You are given an array A of size N, with all values as non-negative integers. Bodega asked you whether it is possible to partition the array into exactly K non-empty subarrays such that the sum of values of each subarray is equal. If it is possible print "Yes", otherwise print "No".

Note:
Every element of the array should belong to exactly one subarray in the partition.The first line consists of two space-separated integers N and K respectively.
The second line consists of N space-separated integers – A<sub>1</sub>, A<sub>2</sub>, ... A<sub>N</sub>.

<b>Constraints:</b>
1 &le; N &le; 10<sup>5</sup>
1 &le; K &le; 20
0 &le; A<sub>i</sub> &le; 10<sup>6</sup>
There exists at least one non-zero element in array A.Print a single word "Yes" if the array can be partitioned into K equal sum parts, otherwise print "No".

Note:
The quotation marks are only for clarity, you should not print them in output.
The output is case-sensitive.Sample Input 1:
5 2
2 2 1 2 2
Sample Output 1:
No

Sample Input 2:
10 3
3 0 1 2 0 0 6 0 1 5
Sample Output 2:
Yes
Explanation:
The array can be partitioned as {3, 0, 1, 2, 0, 0}, {6}, {0, 1, 5}., I have written this Solution Code: import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;


public class Main {

    InputStream is;
    PrintWriter out;
    String INPUT = "";

    void solve(int TC) {
        int n = ni(), k = ni();
        long sum = 0L, tempSum = 0;
        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = ni();
            sum += a[i];
        }
        if (sum % k != 0) {
            pn("No");
            return;
        }
        long req = sum / (long) k;
        for (int i : a) {
            tempSum += i;
            if (tempSum == req) {
                tempSum = 0;
            } else if (tempSum > req) {
                pn("No");
                return;
            }
        }
        pn(tempSum == 0 ? "Yes" : "No");
    }

    boolean TestCases = false;

    public static void main(String[] args) throws Exception {
        new Main().run();
    }

    void hold(boolean b) throws Exception {
        if (!b) throw new Exception("Hold right there, Sparky!");
    }

    static void dbg(Object... o) {
        System.err.println(Arrays.deepToString(o));
    }

    void run() throws Exception {
        is = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());
        out = new PrintWriter(System.out);
        long s = System.currentTimeMillis();
        int T = TestCases ? ni() : 1;
        for (int t = 1; t <= T; t++) solve(t);
        out.flush();
        if (!INPUT.isEmpty()) tr(System.currentTimeMillis() - s + "ms");
    }

    void p(Object o) {
        out.print(o);
    }

    void pn(Object o) {
        out.println(o);
    }

    void pni(Object o) {
        out.println(o);
        out.flush();
    }

    int ni() {
        int num = 0, b;
        boolean minus = false;
        while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        while (true) {
            if (b >= '0' && b <= '9') {
                num = num * 10 + (b - '0');
            } else {
                return minus ? -num : num;
            }
            b = readByte();
        }
    }

    long nl() {
        long num = 0;
        int b;
        boolean minus = false;
        while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        while (true) {
            if (b >= '0' && b <= '9') {
                num = num * 10 + (b - '0');
            } else {
                return minus ? -num : num;
            }
            b = readByte();
        }
    }

    double nd() {
        return Double.parseDouble(ns());
    }

    char nc() {
        return (char) skip();
    }

    int BUF_SIZE = 1024 * 8;
    byte[] inbuf = new byte[BUF_SIZE];
    int lenbuf = 0, ptrbuf = 0;

    int readByte() {
        if (lenbuf == -1) throw new InputMismatchException();
        if (ptrbuf >= lenbuf) {
            ptrbuf = 0;
            try {
                lenbuf = is.read(inbuf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (lenbuf <= 0) return -1;
        }
        return inbuf[ptrbuf++];
    }

    boolean isSpaceChar(int c) {
        return !(c >= 33 && c <= 126);
    }

    int skip() {
        int b;
        while ((b = readByte()) != -1 && isSpaceChar(b)) ;
        return b;
    }

    String ns() {
        int b = skip();
        StringBuilder sb = new StringBuilder();
        while (!(isSpaceChar(b))) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    char[] ns(int n) {
        char[] buf = new char[n];
        int b = skip(), p = 0;
        while (p < n && !(isSpaceChar(b))) {
            buf[p++] = (char) b;
            b = readByte();
        }
        return n == p ? buf : Arrays.copyOf(buf, p);
    }

    void tr(Object... o) {
        if (INPUT.length() > 0) System.out.println(Arrays.deepToString(o));
    }
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?