#include <bits/stdc++.h>
using namespace std;
const int N = 100005, L = 105, M = 1000000007;
int n, m, a[N], c[N][L], ans[N][L], l, r, k;
int main() {
  c[0][0] = 1;
  for (int i = 1; i < N; i++) {
    c[i][0] = 1;
    for (int j = 1; j <= i && j < L; j++)
      c[i][j] = (c[i - 1][j - 1] + c[i - 1][j]) % M;
  }
  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]) % M;
    for (int i = 0; i <= k; i++)
      ans[r + 1][i] = (ans[r + 1][i] - c[r - l + k + 1][k - i] + M) % M;
  }
  for (int i = 1; i < n; i++)
    for (int j = 101; j >= 1; j--)
      ans[i + 1][j - 1] =
          ((long long)ans[i + 1][j - 1] + ans[i][j] + ans[i][j - 1]) % M;
  for (int i = 1; i <= n; i++) printf("%d ", (ans[i][0] + a[i]) % M);
  return 0;
}
