# CodeForces - 978F Mentors(思维)

#include <bits/stdc++.h>
#define INF 0x3f3f3f3f
#define EPS 1e-8
#define lson l, m, rt<<1
#define rson m+1, r, rt<<1|1
using namespace std;
typedef long long LL;
typedef pair<int, int> P;
const int maxn = 2e5 + 5;
const int mod = 1e8 + 7;

int n,k;
struct node{
int v,pos,ans;
}a[maxn];
bool cmp1(node x,node y){
return x.v<y.v;
}
bool cmp2(node x,node y){
return x.pos<y.pos;
}
vector<int>q[maxn];
int ef(int x){
int l=1,r=n;
while (r>=l){
int mid=(l+r)/2;
if (a[mid].v>=x) r=mid-1;
else l=mid+1;
}
return l;
}
int main() {
while (~scanf ("%d%d",&n,&k)){
for (int i=1;i<=n;i++){
scanf ("%d",&a[i].v);
a[i].pos=i;
a[i].ans=0;
q[i].clear();
}
for (int i=0;i<k;i++){
int x,y;
scanf ("%d%d",&x,&y);
if (a[x].v>a[y].v) q[x].push_back(y);
else if (a[x].v<a[y].v) q[y].push_back(x);
}
sort(a+1,a+n+1,cmp1);
for (int i=1;i<=n;i++){
a[i].ans=ef(a[i].v)-1-q[a[i].pos].size();
}
sort(a+1,a+n+1,cmp2);
for (int i=1;i<=n;i++){
printf ("%d ",a[i].ans);
}
printf ("\n");
}
return 0;
}