#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
const ll oo = 1e18;
const ll mod = 1e9 + 7, maxn = 100100;
const double PI = acos(-1);
vector<ll> fat(maxn), inv(maxn);
ll fexp(ll base, ll p) {
  ll ans = 1;
  while (p) {
    if (p & 1) ans = (ans * base) % mod;
    base = (base * base) % mod;
    p = p >> 1;
  }
  return ans;
}
void init() {
  fat[0] = fat[1] = inv[1] = 1;
  for (ll i = 2; i < maxn; i++) {
    fat[i] = (fat[i - 1] * i) % mod;
    inv[i] = fexp(fat[i], mod - 2);
  }
}
ll combina(ll n, ll k) {
  if (n == k || k == 0) return 1;
  if (n < k) return 0;
  return (((fat[n] * inv[k]) % mod) * inv[n - k]) % mod;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  init();
  int n, m, l, r, k;
  cin >> n >> m;
  vector<vector<ll>> dp(110, vector<ll>(maxn, 0));
  vector<int> a(n + 1);
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < m; i++) {
    cin >> l >> r >> k;
    dp[k][l] += 1;
    for (int j = 0; j <= k; j++) {
      dp[j][r + 1] -= combina(r - l + (k - j), k - j);
    }
  }
  for (int i = 105; i >= 0; i--) {
    for (int j = 1; j <= n + 1; j++) {
      dp[i][j] = (dp[i][j] + dp[i][j - 1] + dp[i + 1][j] + mod + mod) % mod;
    }
  }
  for (int i = 1; i <= n; i++) {
    cout << (dp[0][i] + a[i] + mod) % mod << " ";
  }
  cout << endl;
  return 0;
}
