#include <bits/stdc++.h>

int main()
{
    using namespace std;
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    long long n;
    cin >> n;
    vector<long long> array(n);
    for(int i = 0;  i < n; i++)
    { 
        cin >> array[i];
    }
    long long t;
    cin >> t;
    vector<long long> Solver(n, 0);
    
    for(int i = 1; i < n; i++)
    {
        Solver[i] = Solver[i - 1];
        if(array[i] < array[i - 1])
            Solver[i]++; 
    }



    while(t--)
    {   
        long long a, b;
        cin >> a >> b;
        a--; b--;
        if(Solver[b] - Solver[a] <= 1)
        { 
            cout << "DA" << endl;
        }
        else
        { 
            cout << "NE" << endl;
        }

    }

    
    return 0;
}