import ru.ifmo.testlib.*;

import java.math.BigInteger;

import static ru.ifmo.testlib.Outcome.Type.*;

public class Check implements Checker {
    public Outcome test(InStream inf, InStream ouf, InStream ans) {
        int n = inf.nextInt();
        int k = inf.nextInt();
	int[] a = new int[n - k + 1];
        for (int i = 0; i < n - k + 1; i++) {
        	a[i] = inf.nextInt();
	}
	int[] p = new int[n];
	int[] check = new int[n + 1];
	for (int i = 0; i < n; i++) {
		p[i] = ouf.nextInt();
		if (p[i] < 1 || p[i] > n) {
			return new Outcome(Outcome.Type.PE, "Bad element in permutation " + Integer.toString(i + 1));
		}
		check[p[i]]++;
	}
	for (int i = 1; i < n + 1; i++) {
		if (check[i] != 1) {
			return new Outcome(Outcome.Type.PE, "Bad permutation, can't find or found twice " + Integer.toString(i));
		}
	}
	for (int i = 0; i < n - k + 1; i++) {
	    	int cur = 0;
		for (int j = i; j < i + k; j++) {
			for (int q = j + 1; q < i + k; q++) {
				if (p[j] > p[q]) cur++;
			}
		}
		if (cur != a[i]) {
			return new Outcome(Outcome.Type.WA, "Bad count of inversion in position " + Integer.toString(i + 1));
		}
	}               
        return new Outcome(Outcome.Type.OK, "");
    }
}
