#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m;
  cin >> n >> m;
  pair<int, int> a[n];
  map<int, int> mp;
  for (int i = 0; i < n; ++i) {
    cin >> a[i].first;
    a[i].second = i;
  }
  sort(a, a + n);
  int us[n];
  for (int i = 0; i < n; ++i) {
    us[a[i].second] = i;
  }
  vector<int> ans(n);
  while (m-- > 0) {
    int b, c;
    cin >> b >> c;
    --b;
    --c;
    b = us[b];
    c = us[c];
    if (a[b].first == a[c].first) {
    } else {
      --ans[max(b, c)];
    }
  }
  for (int i = 0; i < n; ++i) {
    int to = us[i];
    cout << ans[to] + to - mp[a[to].first] << ' ';
    ++mp[a[to].first];
  }
}
