#include <bits/stdc++.h>
using namespace std;
long long a[310000];
long long s[310000];
long long f[310000], g[310000];
int n, m;
int kk;
long long d[310000];
int l[800 + 50], r[800 + 50];
int main() {
  while (cin >> n >> m) {
    f[0] = 0;
    f[1] = 1;
    g[0] = 0;
    g[1] = 1;
    for (int i = 2; i <= n + 10; i++) {
      f[i] = (f[i - 1] + f[i - 2]) % 1000000009;
      g[i] = (g[i - 1] + f[i]) % 1000000009;
    }
    s[0] = 0;
    for (int i = 1; i <= n; i++) {
      scanf("%I64d", &a[i]);
      s[i] = (s[i - 1] + a[i]) % 1000000009;
    }
    memset(d, 0, sizeof(d));
    int oper, li, ri;
    kk = 0;
    for (int i = 0; i < m; i++) {
      scanf("%d%d%d", &oper, &li, &ri);
      if (oper == 1) {
        l[kk] = li, r[kk] = ri;
        d[li] = (d[li] + 1) % 1000000009;
        d[ri + 1] = ((d[ri + 1] - f[ri - li + 2]) % 1000000009 + 1000000009) %
                    1000000009;
        d[ri + 2] = ((d[ri + 2] - f[ri - li + 1]) % 1000000009 + 1000000009) %
                    1000000009;
        kk++;
        if (kk == 800) {
          for (int i = 1; i <= n; i++) {
            if (i == 1)
              a[i] = (a[i] + d[i]) % 1000000009;
            else {
              d[i] = (d[i] + d[i - 1] + d[i - 2]) % 1000000009;
              a[i] = (a[i] + d[i]) % 1000000009;
            }
            s[i] = (s[i - 1] + a[i]) % 1000000009;
          }
          memset(d, 0, sizeof(d));
          kk = 0;
        }
      } else {
        long long res =
            ((s[ri] - s[li - 1]) % 1000000009 + 1000000009) % 1000000009;
        for (int j = 0; j < kk; j++) {
          int lb = max(l[j], li);
          int rb = min(r[j], ri);
          if (lb <= rb) {
            res = (res + (g[rb - l[j] + 1] - g[lb - l[j]]) % 1000000009 +
                   1000000009) %
                  1000000009;
          }
        }
        printf("%I64d\n", res);
      }
    }
  }
  return 0;
}
