#include <bits/stdc++.h>
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

using namespace std;

int main()
{
    fast;
    int n;
    cin >> n;
    vector<int> v; // glavni niz
    vector<int> r; // od L = 1, koliko puta opada
    v.push_back(0);
    r.push_back(0);
    bool ok12 = true;

    for(int i = 1; i <= n; i++)
    {
        int broj;
        cin >> broj;
        v.push_back(broj);
        if(broj != 1 && broj != 2) ok12 = false;
    }

    r.push_back(0);

    for(int i = 2; i <= n; i++)
    {
        if(v[i] < v[i - 1])
        {
            r.push_back(r[i - 1] + 1);
        }
        else
        {
            r.push_back(r[i - 1]);
        }
    }

    int q;
    cin >> q;

    while(q--)
    {
        int L, R;
        cin >> L >> R;
        if(R - L <= 1) cout << "DA\n";
        else if(ok12 && v[L] == 1 && v[R] == 1 && R - L >= 3 && r[R] - r[L] >= 1) cout << "NE\n";
        else if(r[R] - r[L] > 1) cout << "NE\n";
        else cout << "DA\n";
    }
    return 0;
}