#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie();

    int n;
    cin>>n;
    vector<int> a(n);
    for(int i=0;i<n;i++)
        cin>>a[i];

    int q,x,y,br;
    cin>>q;
    while(q--){
        br=0;
        cin>>x>>y;
        if(y-x==0){
            cout<<"DA"<<endl;
            continue;
        }
        for(int i=x-1;i<y-1;i++){
            if(a[i]>a[i+1])br++;
            if(br>1)break;
        }
        if(br>1){
            cout<<"NE"<<endl;
            continue;
        }
        cout<<"DA"<<endl;
    }

    return 0;
}