#include <bits/stdc++.h>
using namespace std;
const int mod = (int)(1e9 + 7);
const int maxn = 100011;
const int MAXN = 103;
long long f[MAXN][maxn];
int C[maxn][MAXN];
long long a[maxn];
int main() {
  ios::sync_with_stdio(false);
  int n, m, i, j, l, r, k;
  cin >> n >> m;
  for (i = 0; i < maxn; ++i) {
    C[i][0] = 1;
  }
  for (i = 1; i < maxn; ++i) {
    for (j = 1; j < MAXN; ++j) {
      C[i][j] = C[i - 1][j - 1] + C[i - 1][j];
      if (C[i][j] >= mod) C[i][j] -= mod;
    }
  }
  for (i = 1; i <= n; ++i) {
    cin >> a[i];
  }
  int p = 0;
  for (i = 0; i < m; ++i) {
    cin >> l >> r >> k;
    ++f[k + 1][l];
    p = 0;
    for (j = k + 1; j > 0; --j, ++p) {
      f[j][r + 1] += mod - C[r - l + p][p];
    }
  }
  for (j = 100; j >= 0; --j) {
    long long t = 0;
    for (i = 1; i <= n; ++i) {
      t += f[j + 1][i];
      t %= mod;
      f[j][i] += t;
      f[j][i] %= mod;
    }
  }
  for (i = 1; i <= n; ++i) {
    a[i] += f[0][i];
    a[i] %= mod;
    if (i ^ 1) cout << " ";
    cout << a[i];
  }
  cout << endl;
  return 0;
}
