#include <bits/stdc++.h>
using namespace std;
const int maxn = 300010;
const int mod = 1e9 + 9;
int f[maxn], sfib[maxn], d[maxn], s[maxn], a[maxn];
int L[maxn / 100], R[maxn / 100];
void init() {
  sfib[1] = f[1] = 1;
  for (int i = 2; i <= maxn - 10; i++) {
    f[i] = (f[i - 1] + f[i - 2]) % mod;
    sfib[i] = (sfib[i - 1] + f[i]) % mod;
  }
}
int main() {
  init();
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    s[i] = (s[i - 1] + a[i]) % mod;
  }
  int op, l, r, k = 1;
  int SZ = sqrt(m + 0.5);
  while (m--) {
    scanf("%d%d%d", &op, &l, &r);
    if (op == 1) {
      L[k] = l, R[k++] = r;
      d[l] = (d[l] + 1) % mod;
      d[r + 1] = (d[r + 1] - f[r - l + 2] + mod) % mod;
      d[r + 2] = (d[r + 2] - f[r - l + 1] + mod) % mod;
      if (k > SZ) {
        for (int i = 1; i <= n; i++) {
          if (i >= 2) d[i] = ((d[i] + d[i - 1]) % mod + d[i - 2]) % mod;
          a[i] = (a[i] + d[i]) % mod;
          s[i] = (s[i - 1] + a[i]) % mod;
        }
        k = 1;
        memset(d, 0, sizeof(d));
      }
    } else {
      int ret = 0, lt, rt;
      for (int i = 1; i < k; i++) {
        lt = max(L[i], l), rt = min(R[i], r);
        if (lt > rt) continue;
        ret = (ret + sfib[rt - L[i] + 1] - sfib[lt - L[i]]) % mod;
      }
      ret = (ret + s[r] - s[l - 1]) % mod;
      printf("%d\n", (ret % mod + mod) % mod);
    }
  }
  return 0;
}
