#include <cstdlib>
#include <iostream>
#include <cmath>
#include <algorithm>
using namespace std;

int main(int argc, char *argv[])
{
    int n;
    cin >> n;
    int a[n];
    for(int i = 0; i<n;i++)
    {
            a[i] = 0;
    }
    int p, x;
    cin >>p;
    for(int i = 1; i<n;i++)
    {
            cin >> x;
            if(x<p) a[i]=a[i-1]+1;
            else a[i] = a[i-1];
            p = x;
    }
    int q;
    cin >> q;
    int l, r;
    for(int i =0;i<q;i++)
    {
            cin >> l >> r;
            l--;
            r--;
            if(a[r]-a[l] <= 1) cout << "DA" << endl;
            else cout << "NE" << endl;
    }
    system("PAUSE");
    return EXIT_SUCCESS;
}