#include <iostream>
#include <string>
#define maxN 200001
#define maxQ 100001

using namespace std;

int main()
{
    int n, q, a[maxN], i, l, r, j, p;
    bool qa[maxQ], t = true;
    cin >> n;
    for ( i = 0; i < n; i ++ )
    {
        cin >> a[i];
    }
    cin >> q;
    for ( i = 0; i < q; i ++ )
    {
        qa[i] = true;
        cin >> l >> r;
        l --;
        r --;
        for ( j = l; j < r; j ++ )
        {
            if ( a[j+1] < a[j] )
            {
                if( t == false )
                {
                    qa[i] = false;
                    j = r;
                }
                else
                {
                    t = false;
                    if ( a[j+1] < a[j-1] && j >= l + 1 && a[j+2] < a[j])
                    {
                        qa[i] = false;
                        j = r;
                    }
                }
            }
        }
        t = true;
    }
    for ( i = 0; i < q; i ++ )
    {
        if (qa[i] == true )
            cout << "DA" << endl;
        else cout << "NE" << endl;
    }
    return 0;
}