#include <bits/stdc++.h>
using namespace std;
const int maxn = 100000 + 1000;
const int maxm = 100 + 10;
const int mod = 1000000007;
long long C[maxn][maxm];
long long ans[maxn][maxm];
int a[maxn];
void init() {
  C[0][0] = 1;
  for (int i = 1; i < maxn; ++i) {
    C[i][0] = 1;
    for (int j = 1; j <= i && j < maxm; ++j)
      C[i][j] = (C[i - 1][j - 1] + C[i - 1][j]) % mod;
  }
}
int main() {
  init();
  int n, m, l, r, k;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  while (m--) {
    scanf("%d%d%d", &l, &r, &k);
    for (int i = 0; i <= k; i++) ans[l][i] = (ans[l][i] + C[k][k - i]) % mod;
    for (int i = 0; i <= k; i++)
      ans[r + 1][i] = (ans[r + 1][i] - C[k + r - l + 1][k - i]) % mod;
  }
  for (int i = 1; i < n; i++)
    for (int j = 101; j >= 1; j--)
      ans[i + 1][j - 1] = (ans[i + 1][j - 1] + ans[i][j] + ans[i][j - 1]) % mod;
  for (int i = 1; i <= n; i++)
    printf("%lld ", ((ans[i][0] + a[i]) % mod + mod) % mod);
  printf("\n");
  return 0;
}
