#include <bits/stdc++.h>

using namespace std;


int n,q;
int A[200100];
pair<int,int> Q[200100];
int b=0;
pair<int,int> B[200100];


bool t4 = true;


void check(int l,int r)
{
    for(int i=0;i<b;i++)
    {
        if(l >= B[i].first and r <= B[i].second)
        {
            cout<<"DA"<<endl;
            return;
        }
    }
    cout<<"NE"<<endl;
    return;
}


void makeborders(int i)
{
    int X = -1;
    int l = i,r = n;
    while(i < n)
    {
        if(A[i] > A[i+1])
        {
            if(X == -1)
            {
                X = i;
            }else{
                r = i;
                B[b].first = l;
                B[b].second = r;
                b++;
                makeborders(X+1);
                return;
            }
        }
        i++;
    }
    B[b].first = l;
    B[b].second = r;
    b++;
}


void test4(int i)
{
    if(i>=n)
    {
        return;
    }
    int l=i,r,X;
    if(A[i] == 1)
    {
        while(A[i] == 1 and i < n)
        {
            i++;
        }
        X=i;
        i++;
        if(A[i] == 1)
        {
            while(A[i] == 1 and i < n)
            {
                i++;
            }
            r = i-1;
            B[b].first = l;
            B[b].second = r;
            b++;
            test4(X);
        }
        else
        {
            while(A[i] == 2 and i < n)
            {
                i++;
            }
            i++;
            if(A[i] == 1)
            {
                r = i-1;
                B[b].first = l;
                B[b].second = r;
                b++;
                test4(X);
            }
            else
            {
                while(A[i] == 2 and i < n)
                {
                    i++;
                }
                r=i-1;
                B[b].first = l;
                B[b].second = r;
                b++;
                test4(X);
            }
        }
    }
    else
    {
        if(A[i+1] == 2)
        {
            while(A[i] == 2 and i < n)
            {
                i++;
            }
            i++;
            if(A[i] == 1)
            {
                r = i - 1;
                B[b].first = l;
                B[b].second = r;
                b++;
                test4(i-2);
            }
            else
            {
                X=i;
                while(A[i] == 2 and i < n)
                {
                    i++;
                }
                r = i - 1;
                B[b].first = l;
                B[b].second = r;
                b++;
                test4(X);
            }
        }
        else
        {
            i++;
            if(A[i+1] == 1)
            {
                X = i;
                while(A[i] == 1)
                {
                    i++;
                }
                r = i-1;
                B[b].first = l;
                B[b].second = r;
                b++;
                test4(X);
            }
            else
            {
                X=i;
                i++;
                while(A[i] == 2)
                {
                    i++;
                }
                r = i;
                B[b].first = l;
                B[b].second = r;
                b++;
                test4(X);
            }
        }
    }
}


int main()
{
    cin>>n;
    for(int i=0;i<n;i++)
    {
        cin>>A[i];
        if(A[i] != 1 and A[i] != 2)
        {
            t4 = false;
        }
    }
    if(t4 == true)
    {
        test4(0);
    }
    else
    {
        makeborders(0);
    }
    cin>>q;
    int l,r;
    for(int i=0;i<q;i++)
    {
        cin>>Q[i].first>>Q[i].second;
    }
    for(int i=0;i<q;i++)
    {
        if(Q[i].first == Q[i].second)
        {
            cout<<"DA"<<endl;
        }
        else
        {
            check(Q[i].first-1,Q[i].second-1);
        }
    }






    /*for(int i=0;i<b;i++)
    {
        cout<<B[i].first<<" "<<B[i].second<<endl;
    }*/




    return 0;
}