#include <iostream>
using namespace std;

int main() 
{
    int n,q,a[200000],i;
    cin >> n;
    for(i=1;i<=n;i++)
    {
        cin >> a[i];
    }
    
    cin >> q;
    int l,r,ind,preth;

    for(int j=0;j<q;j++)
    {
        cin >> l >> r;
        ind = 0;
        for(i=l+1;i<=r;i++)
        {
            preth = a[i-1];
            
            if(a[i] < preth)
            {
                if(ind == 0)
                {
                    ind = 1;
                }
                else
                {
                    cout << "NE" << endl;
                    i=r+2;
                }
            }
            
        }
        
        if(i==r+1)
        {
            cout <<"DA"<< endl;
        }
    }

    return 0;
}