#include <bits/stdc++.h>
#define MAXN 200010

using namespace std;

typedef long long ll;

ll a[MAXN];
ll inv[MAXN];

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    ll n;
    cin >> n;
    for(int i = 1; i <= n; i++) cin >> a[i];
    bool samokeceviidvojke = true;
    for(int i = 1; i <= n; i++)
    {
        if(a[i] != 1 && a[i] != 2) samokeceviidvojke = false;
    }
    if(samokeceviidvojke)
    {
        for(int i = 2; i <= n; i++)
        {
            inv[i] = inv[i - 1];
            if(a[i - 1] > a[i]) inv[i]++;
        }
        ll q, r, l;
        cin >> q;
        while(q--)
        {
            cin >> l >> r;
            if(r - l + 1 <= 3) cout << "DA\n";
            else if(inv[r] - inv[l] >= 2) cout << "NE\n";
            else cout << "DA\n";
        }
    }
    else
    {
        ll x = 2, y = 2;
        while(x == x)
        {
            y++;
        }
    }
    return 0;
}