#include <bits/stdc++.h>
using namespace std;
vector<long long int> emptyVector;
const long long int MAX = 5e5 + 5;
const long long int INF = 1e18;
const long long int MOD = 1e9 + 7;
long long int binaryExpo(long long int x, long long int n) {
  if (n == 0) return 1;
  if (n % 2 == 0) return binaryExpo((x * x) % MOD, n / 2);
  return (x * binaryExpo((x * x) % MOD, n / 2)) % MOD;
}
void solve(void) {
  int n, k;
  cin >> n >> k;
  vector<int> ans(n, 0), cnt(n, 0);
  vector<vector<int> > skill(n, vector<int>(2));
  for (int i = 0; i < n; i++) {
    cin >> skill[i][0];
    skill[i][1] = i;
  }
  for (int i = 0; i < k; i++) {
    int x, y;
    cin >> x >> y;
    x--, y--;
    if (skill[x][0] > skill[y][0])
      cnt[x]--;
    else if (skill[x][0] < skill[y][0])
      cnt[y]--;
  }
  sort(skill.begin(), skill.end());
  ans[skill[0][1]] = 0;
  for (int i = 1; i < n; i++) {
    if (skill[i][0] > skill[i - 1][0])
      ans[skill[i][1]] += i;
    else
      ans[skill[i][1]] = ans[skill[i - 1][1]];
  }
  for (int i = 0; i < n; i++) cout << ans[i] + cnt[i] << " ";
  cout << "\n";
}
int main(void) {
  { solve(); }
  return 0;
}
