#include <bits/stdc++.h>
using namespace std;
const int Mod = 1e9 + 7;
const int K = 101;
const int N = 1e5 + 1 + K;
int a[N], b[N], f[N], d[N];
vector<int> add[K];
vector<pair<int, int>> sub[K];
int power(int a, int b) {
  int ans = 1;
  while (b) {
    if (b & 1) ans = 1LL * ans * a % Mod;
    b >>= 1;
    a = 1LL * a * a % Mod;
  }
  return ans;
}
void pre() {
  f[0] = 1;
  for (int i = 1; i < N; i++) f[i] = 1LL * f[i - 1] * i % Mod;
  d[N - 1] = power(f[N - 1], Mod - 2);
  for (int i = N - 2; i >= 0; i--) d[i] = 1LL * d[i + 1] * (i + 1) % Mod;
}
int C(int n, int k) { return 1LL * f[n] * d[k] % Mod * d[n - k] % Mod; }
int main() {
  pre();
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 0; i < m; i++) {
    int l, r, k;
    cin >> l >> r >> k;
    add[K - 1 - k].push_back(l);
    for (int z = k; z >= 0; z--)
      sub[K - 1 - z].push_back({r + 1, C(r - l + k - z, k - z)});
  }
  for (int i = 0; i < K; i++) {
    for (auto x : add[i]) b[x]++;
    for (auto p : sub[i]) (b[p.first] += Mod - p.second) %= Mod;
    for (int j = 1; j <= n; j++) (b[j] += b[j - 1]) %= Mod;
  }
  for (int i = 1; i <= n; i++) {
    (a[i] += b[i]) %= Mod;
    cout << a[i] << ' ';
  }
}
