#include <bits/stdc++.h>
using namespace std;
const int N = 1e+5;
const int MOD = 1e+9 + 7;
const int K = 100;
int C[N + K + 1][K + 1];
int arr[N], flag[N][K + 1], sum[K + 1];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) scanf("%d", arr + i);
  for (int i = 0; i <= n + K; i++) {
    C[i][0] = 1;
    for (int j = 1; j <= min(K, i); j++)
      C[i][j] = (C[i - 1][j] + C[i - 1][j - 1]) % MOD;
  }
  while (m--) {
    int low, high, k;
    scanf("%d%d%d", &low, &high, &k);
    low--, high--;
    for (int i = 0; i <= k; i++) (flag[low][i] += C[k][k - i]) %= MOD;
    if (high + 1 < n)
      for (int i = 0; i <= k; i++)
        (flag[high + 1][i] += MOD - C[k + high - low + 1][k - i]) %= MOD;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j <= K; j++) (sum[j] += flag[i][j]) %= MOD;
    if (i) cout << ' ';
    cout << (arr[i] + sum[0]) % MOD;
    for (int j = 0; j < K; j++) (sum[j] += sum[j + 1]) %= MOD;
  }
  cout << endl;
  return 0;
}
