#include <bits/stdc++.h>
using namespace std;
const int XXY = 1e9 + 9;
int n, m;
int seg[1300000], flag[1300000][2], fab[300010];
inline int find(int x, int y, int num) {
  if (num == 1) return x;
  if (num == 2) return y;
  return (1ll * x * fab[num - 2] + 1ll * y * fab[num - 1]) % XXY;
}
inline int work(int x, int y, int num) {
  return (find(x, y, num + 2) - y + XXY) % XXY;
}
inline void pull(int rt) {
  (seg[rt] = seg[rt << 1] + seg[(rt << 1) + 1]) %= XXY;
}
void push(int rt, int l, int r, int len) {
  if (flag[rt][0] || flag[rt][1]) {
    int lson = rt << 1, rson = (rt << 1) + 1, mid = (l + r) >> 1;
    (flag[lson][0] += flag[rt][0]) %= XXY;
    (flag[lson][1] += flag[rt][1]) %= XXY;
    int rx = find(flag[rt][0], flag[rt][1], mid - l + 2),
        ry = find(flag[rt][0], flag[rt][1], mid - l + 3);
    (flag[rson][0] += rx) %= XXY;
    (flag[rson][1] += ry) %= XXY;
    (seg[lson] += work(flag[rt][0], flag[rt][1], mid - l + 1)) %= XXY;
    (seg[rson] += work(rx, ry, r - mid)) %= XXY;
    flag[rt][0] = flag[rt][1] = 0;
  }
}
void build(int rt, int l, int r) {
  flag[rt][0] = 0;
  flag[rt][1] = 0;
  if (l == r) {
    scanf("%d", &seg[rt]);
    return;
  }
  int mid = (l + r) >> 1;
  build(rt << 1, l, mid);
  build((rt << 1) + 1, mid + 1, r);
  pull(rt);
}
void update(int rt, int l, int r, int x, int y) {
  if (x <= l && r <= y) {
    (flag[rt][0] += fab[l - x + 1]) %= XXY;
    (flag[rt][1] += fab[l - x + 2]) %= XXY;
    (seg[rt] += work(fab[l - x + 1], fab[l - x + 2], r - l + 1)) %= XXY;
    return;
  }
  push(rt, l, r, r - l + 1);
  int mid = (l + r) >> 1;
  if (mid >= x) update(rt << 1, l, mid, x, y);
  if (mid < y) update((rt << 1) + 1, mid + 1, r, x, y);
  pull(rt);
}
int query(int rt, int l, int r, int x, int y) {
  if (x <= l && r <= y) return seg[rt];
  push(rt, l, r, r - l + 1);
  int mid = (l + r) >> 1, ans = 0;
  if (mid >= x) ans += query(rt << 1, l, mid, x, y);
  if (mid < y) ans += query((rt << 1) + 1, mid + 1, r, x, y);
  return ans % XXY;
}
int main() {
  scanf("%d%d", &n, &m);
  build(1, 1, n);
  fab[1] = fab[2] = 1;
  for (int i = 3; i <= n + 10; i++) {
    fab[i] = (fab[i - 1] + fab[i - 2]) % XXY;
  }
  int op, par1, par2;
  for (int i = 1; i <= m; i++) {
    scanf("%d%d%d", &op, &par1, &par2);
    if (op == 1)
      update(1, 1, n, par1, par2);
    else
      printf("%d\n", query(1, 1, n, par1, par2));
  }
  return 0;
}
