#include <iostream>
#include <algorithm>
#include <vector>
#define rep(i, n) for(i = 0; i < n; i++)
using namespace std;

struct Value {
	int depth, cost;
	Value() { }
	Value(int depth, int cost) {
		this->depth = depth;
		this->cost = cost;
	}
};

int n, k;
int a[100000];
vector<int> et[100000];

Value dfs(int p, int v) {
	Value ret(0, 0);
	
	for (int i = 0; i < et[v].size(); i++) {
		int nv = et[v][i];
		if (nv == p) continue;
		Value res = dfs(v, nv);
		ret.depth = max(ret.depth, res.depth + 1);
		ret.cost += res.cost;
	}
	
	if (ret.depth == k - 1 && p != 0) {
		ret.depth = -1;
		ret.cost++;
	}
	return ret;
}

int main() {
	int i;
	
	cin >> n >> k;
	rep(i, n) {
		cin >> a[i]; a[i]--;
		if (i != 0) {
			et[a[i]].push_back(i);
		}
	}
	
	int ans = dfs(0, 0).cost;
	if (a[0] != 0) ans++;
	cout << ans << endl;
	return 0;
}
#include <bits/stdc++.h>

#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;

template<class T> T gcd(const T& a,const T& b){ return b==0?a:gcd(b,a%b); }

int main(){
	int n,k; scanf("%d%d",&n,&k);
	vector<int> a(n);
	rep(i,n) scanf("%d",&a[i]);

	int g=a[0];
	rep(i,n-1) g=gcd(g,a[i+1]);

	puts(k%g==0&&k<=*max_element(a.begin(),a.end())?"POSSIBLE":"IMPOSSIBLE");

	return 0;
}
