#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n,k;
    cin>>n;
    vector <int> a;
    int dp[n];
    int sl=0;
    for (int i=0;i<n;i++)
    {
        cin>>k;
        if (k!=1)
        {
            if (k!=2)
            {
                sl=1;
            }
        }
        a.push_back(k);
        if (i==0)
        {
            dp[i]=0;
        }
        else
        {
            if (a[i-1]>a[i])
            {
                dp[i]=dp[i-1]+1;
            }
            else
            {
                dp[i]=dp[i-1];
            }
        }
    }
    //cout<<sl<<endl;
    if (sl==1)
    {
        int q;
        cin>>q;
        int l,r;
        for (int i=0;i<q;i++)
        {
            cin>>l>>r;
            int tren=dp[r-1] - dp[l-1];
            if (tren>1)
            {
                cout<<"NE"<<endl;
            }
            else
            {
                cout<<"DA"<<endl;
            }
        }
    }
    else if (sl==0)
    {
        int q;
        cin>>q;
        int l,r;
        vector <int> b;
        for (int i=0;i<q;i++)
        {
            cin>>l>>r;
            for (int j=l-1;j<=r-1;j++)
            {
                b.push_back(a[j]);
            }
            int brojdvojki=0;
        int brojjedinicado=0;
        dp[0]=0;
        if (b[0]==2)
        {
            brojdvojki=1;
        }

        for (int i=0;i<b.size();i++)
        {
            if (b[i]==2)
            {
                brojdvojki++;
            }
            if (b[i]==1 && brojdvojki!=0)
            {
                brojjedinicado++;
            }
                dp[i]=min(brojdvojki,brojjedinicado);
                //cout<<brojdvojki<<" "<<brojjedinicado<<endl;
            }
            int tren=dp[b.size()-1];
            if (tren>1)
            {
                cout<<"NE"<<endl;
            }
            else
            {
                cout<<"DA"<<endl;
            }
            b.clear();
        }

    }
}