#include <bits/stdc++.h>
using namespace std;
const int INF = 2147483645;
int n, k, maxw = 0, minw = 0, cur, ans[200500], anger[200500];
set<int> s[200500];
int main() {
  ios::sync_with_stdio(0);
  cin.tie();
  cout.tie();
  cin >> n >> k;
  vector<pair<int, int>> v(n);
  for (int i = 0; i < n; i++) {
    cin >> v[i].first;
    v[i].second = i;
  }
  for (int i = 0; i < k; i++) {
    int x, y;
    cin >> x >> y;
    if (v[x - 1].first != v[y - 1].first) {
      s[x - 1].insert(y - 1);
      s[y - 1].insert(x - 1);
    }
  }
  sort(v.begin(), v.end(), greater<pair<int, int>>());
  for (int i = 0; i < n; i++) {
    for (int x : s[v[i].second]) anger[x]++;
    int kek = upper_bound(v.begin(), v.end(), pair<int, int>{v[i].first, 0},
                          greater<pair<int, int>>()) -
              v.begin();
    ans[v[i].second] =
        max(0, n - kek - (int)s[v[i].second].size() + anger[v[i].second]);
  }
  for (int i = 0; i < n; i++) cout << ans[i] << " ";
  return 0;
}
