#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 9;
const int N = 300009;
long long f[N];
int a[N];
void precalc() {
  f[1] = 1;
  for (int i = 2; i <= 3e5 + 3; i++) f[i] = (f[i - 1] + f[i - 2]) % mod;
}
long long get_kth(long long a, long long b, int k) {
  if (k == 1) return a;
  if (k == 2) return b;
  long long res = a * f[k - 2] + b * f[k - 1];
  res %= mod;
  return res;
}
long long sum(long long a, long long b, int len) {
  long long fk = get_kth(a, b, len + 2);
  long long res = (fk - b + mod) % mod;
  return res;
}
int n;
struct segmentTree {
  long long t[4 * N];
  pair<int, int> lazy[4 * N];
  void build(int p = 1, int l = 0, int r = n - 1) {
    if (l == r) return void(t[p] = a[l]);
    build(p << 1, l, ((l + r) >> 1));
    build(p << 1 | 1, ((l + r) >> 1) + 1, r);
    t[p] = t[p << 1] + t[p << 1 | 1];
    t[p] %= mod;
  }
  void push(int p, int l, int r) {
    if (!lazy[p].second && !lazy[p].first) return;
    lazy[p].first %= mod;
    lazy[p].second %= mod;
    if (l != r) {
      lazy[p << 1].first += lazy[p].first;
      lazy[p << 1].first %= mod;
      lazy[p << 1].second += lazy[p].second;
      lazy[p << 1].second %= mod;
      int dif = ((l + r) >> 1) - l + 1;
      auto val = lazy[p];
      lazy[p << 1 | 1].first += get_kth(val.first, val.second, dif + 1);
      lazy[p << 1 | 1].first %= mod;
      lazy[p << 1 | 1].second += get_kth(val.first, val.second, dif + 2);
      lazy[p << 1 | 1].second %= mod;
    }
    t[p] += sum(lazy[p].first, lazy[p].second, r - l + 1);
    t[p] %= mod;
    lazy[p] = {0, 0};
  }
  int ql, qr;
  void update(pair<int, int> val = {1, 1}, int p = 1, int l = 0,
              int r = n - 1) {
    push(p, l, r);
    if (l > qr || r < ql || l > r) return;
    if (l >= ql && r <= qr) {
      lazy[p] = val;
      push(p, l, r);
      return;
    }
    int dif = max(0, ((l + r) >> 1) - max(l, ql) + 1);
    pair<int, int> val2 = {get_kth(val.first, val.second, dif + 1),
                           get_kth(val.first, val.second, dif + 2)};
    update(val, p << 1, l, ((l + r) >> 1));
    update(val2, p << 1 | 1, ((l + r) >> 1) + 1, r);
    t[p] = t[p << 1] + t[p << 1 | 1];
    t[p] %= mod;
  }
  long long query(int p = 1, int l = 0, int r = n - 1) {
    push(p, l, r);
    if (l > qr || r < ql || l > r) return 0;
    if (l >= ql && r <= qr) return t[p];
    long long res = query(p << 1, l, ((l + r) >> 1));
    long long res1 = query(p << 1 | 1, ((l + r) >> 1) + 1, r);
    res = (res + res1) % mod;
    return res;
  }
} st;
int main() {
  precalc();
  int m;
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; i++) scanf("%d", a + i);
  st.build();
  while (m--) {
    int t, l, r;
    scanf("%d %d %d", &t, &l, &r);
    l--, r--;
    st.ql = l;
    st.qr = r;
    if (t == 1) {
      st.update();
    } else {
      long long res = st.query();
      printf("%I64d\n", res);
    }
  }
}
