#include<bits/stdc++.h>
using namespace std;
template <class T> 
void r1(T &x) {
	x = 0;
	char st(getchar());
	int f(1);
	for(; !isdigit(st);st = getchar()) if(st == '-') f = -1;
	for(; isdigit(st);st = getchar()) x = (x << 1) + (x << 3) + (st ^ 48);
	x *= f;
}
const int inf = 2e9;
const int maxn = 3e5 + 5;
int n, m;
int fa[maxn];
int fd(int x) {
	return x == fa[x] ? x : x = fd(fa[x]);
}
int rt;
vector<int> vc[maxn], g[maxn];
int bf[maxn], nx[maxn];
int q[maxn], ans[maxn], vis[maxn];
int st[maxn], in[maxn];
int main() {
	int i;
	r1(n), r1(m);
//	cout << n;
	for(i = 1;i <= n; ++i) {
//		cout << 1;
		int s;
		r1(s);
		fa[i] = i;
		if(s == 0)
		rt = i;
		else 
		vc[s].push_back(i);
	}
//	cout << 1;
	while(m --) {
		int x, y;
		r1(x), r1(y);
		nx[x] = y;
		bf[y] = x;
		x = fd(x), y = fd(y);
		if(x == y) return puts("0"), 0;
		fa[x] = y;
	}
	for(i = 1;i <= n; ++i) {
		if(bf[i] == 0) st[fd(i)] = i;
		for(int j = 0;(unsigned)j < vc[i].size(); ++j) {
			if(fd(i) != fd(vc[i][j])) {
				g[fd(i)].push_back(fd(vc[i][j]));
				in[fd(vc[i][j])] ++;
			}
		}
	}
	int hd(1), tl(1), num(0);
	q[1] = fd(rt);
	while(hd <= tl) {
		int u = q[hd ++];
		int s = st[u];
		while(s) {
			ans[++ num] = s;
			s = nx[s];
		}
		for(i = 0;i < g[u].size(); ++i) {
			int to = g[u][i];
			-- in[to];
			if(in[to] == 0) {
				q[++ tl] = to;
			}
		}
	}
//	cout << 1 <<" --------";
//	for(i = 1;i <= num; ++i) printf("%d ",ans[i]);
	if(num != n) return puts("0"), 0;
//	cout << rt;
	vis[rt] = 1;
	for(i = 1;i <= n; ++i) {
		if(vis[ans[i]] == 0) return puts("0"), 0;
//		cout << vis[3] << " ";
//		for(int j = 1;j <= n; ++j) printf("%d ",vis[j]);
//		cout << 1;
		for(int j = 0;j < vc[ans[i]].size(); ++j) vis[vc[ans[i]][j]] = 1;
	}
	for(i = 1;i <= n; ++i ) printf("%d ",ans[i]);
//	printf("n = %d\n", n);
	return 0;
}