#include using namespace std; using ll = long long; using ull = unsigned long long; #define rep(i,a) for(int i=0;i<(a);i++) #define MOD 1000000007 int p[1000][1000]; int main(){ int n,m; cin>>n>>m; int a[n]; rep(i,n) cin>>a[i]; rep(i,m){ int x,y; cin>>x>>y; x--, y--; p[x][y]=p[y][x]=1; } for(int i=0;i