#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);
    vector<long long> Influence(n, 0);
    Influence[n - 1] = 0;
    for(int i = 1; i < n; i++)
    {
        Solver[i] = Solver[i - 1];
        int k = 1;
        while(array[i] <= array[i - k] && k < n)
        { 
            Solver[i]++; 
            Influence[i - k]++;
            k++;
        }
    }
    for(int i = 1; i < n; i++)
    { 
        Influence[i] += Influence[i - 1]; 
    }
    while(t--)
    {   
        long long a, b;
        cin >> a >> b;
        if(Solver[b]  - Solver[a] - Influence[a - 1] < 1)
        { 
            cout << "DA";
        }
        else
        { 
            cout << "NE";
        }

    }

    
    return 0;
}