#include <bits/stdc++.h>
const int MOD = 1e9 + 7;
using namespace std;
void solve() {
  int n, k;
  cin >> n >> k;
  vector<int> a(n), ans(n), sub(n);
  vector<pair<int, int>> v(n);
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    v[i].first = a[i];
    v[i].second = i;
  }
  sort(v.begin(), v.end());
  for (int i = 0; i < k; ++i) {
    int x, y;
    cin >> x >> y;
    --x, --y;
    if (a[x] < a[y])
      ++sub[y];
    else if (a[x] > a[y])
      ++sub[x];
  }
  int j = 0;
  for (int i = 1; i < n; ++i) {
    while (v[j].first < v[i].first) ++j;
    ans[v[i].second] = max(0, j - sub[v[i].second]);
  }
  for (int i = 0; i < (int)ans.size(); ++i) cout << ans[i] << " ";
  cout << "\n";
  ;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  solve();
}
