#include <bits/stdc++.h>
using namespace std;
const int N = 101010;
const int MOD = 1000000007;
int n, Q;
int a[N];
int delta[111][N];
int C[N][111];
void get_C() {
  for (int i = 0; i < N; ++i) {
    C[i][0] = 1;
    if (i <= 100) C[i][i] = 1;
    for (int j = 1; j < i; ++j) {
      if (j > 100) break;
      C[i][j] = (C[i - 1][j - 1] + C[i - 1][j]) % MOD;
    }
  }
}
int main() {
  get_C();
  cin >> n >> Q;
  for (int i = 1; i <= n; ++i) {
    scanf("%d", a + i);
    a[i] %= MOD;
  }
  memset(delta, 0, sizeof(delta));
  int l, r, k;
  while (Q--) {
    scanf("%d %d %d", &l, &r, &k);
    ++delta[k][l];
    for (int i = 0; i <= k; ++i) {
      delta[i][r + 1] -= C[r - l + k - i][k - i];
      delta[i][r + 1] %= MOD;
      delta[i][r + 1] += MOD;
      delta[i][r + 1] %= MOD;
    }
  }
  for (int i = 100; i >= 0; --i) {
    delta[i][0] = 0;
    for (int j = 1; j <= n; ++j) {
      delta[i][j] =
          ((delta[i][j] + delta[i][j - 1]) % MOD + delta[i + 1][j]) % MOD;
    }
  }
  for (int i = 1; i <= n; ++i) {
    a[i] = (a[i] + delta[0][i]) % MOD;
    printf("%d ", a[i]);
  }
  return 0;
}
