#include <iostream>

using namespace std;

int main()
{
    int n;
    cin>>n;
    
    int a[n];
    for(int i = 0; i<n; i++)
    {
        cin>>a[i];
    }
    
    int Q, l, r, pr = 0;
    cin>>Q;
    int p[Q];
    
    for(int i = 0; i<Q; i++)
    {
        cin>>l;
        cin>>r;
        int f = 0;
        int br = a[0];
        bool m = true;
        
        for(int j = l-1; j<r-1; j++)
        {
            if(a[j]>a[j+1])
            {
                br = a[j];
                a[j] = a[j+1];
                f = j;
                break;
            }
        }
        for(int j =l-1; j<r-1; j++)
        {
            if(a[j]>a[j+1])
            {
                m = false;
                p[pr] = 0;
                pr++;
            }
        }
        
        if(m==true)
        {
            p[pr] = 1;
            pr++;
        }
        a[f] = br;
    }
    
    for(int i = 0; i<Q; i++)
    {
        if(p[i]==1)
        {
            cout<<"DA"<<endl;
        }else
        {
            cout<<"NE"<<endl;
        }
    }

    return 0;
}