#include <bits/stdc++.h>
using namespace std;
int C[100109][110];
int a[100109];
int p[100109][110];
int f[110];
int main() {
  C[0][0] = 1;
  for (int i = 1; i < 100110; i++) {
    C[i][0] = 1;
    for (int j = 1; j < min(i + 1, 101); j++) {
      C[i][j] = (C[i - 1][j - 1] + C[i - 1][j]) % 1000000007;
    }
  }
  int n, m;
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i + 1]);
  }
  for (int i = 0; i < m; i++) {
    int l, r, k;
    scanf("%d %d %d", &l, &r, &k);
    for (int j = 0; j < k + 1; j++) {
      p[l][j] = (p[l][j] + C[k][k - j]) % 1000000007;
      p[r + 1][j] = (p[r + 1][j] - C[r + 1 - l + k][k - j]) % 1000000007;
    }
  }
  for (int i = 1; i < n + 1; i++) {
    for (int j = 0; j < 101; j++) f[j] = (f[j] + p[i][j]) % 1000000007;
    a[i] = (a[i] + f[0]) % 1000000007;
    a[i] = (a[i] + 1000000007) % 1000000007;
    for (int j = 0; j < 100; j++) f[j] = (f[j] + f[j + 1]) % 1000000007;
  }
  for (int i = 1; i < n + 1; i++) printf("%d ", a[i]);
}
