#include <iostream>
#include <bits/stdc++.h>

using namespace std;

int main()
{
    int N,Y, szamok[20001],a,b;
    cin>>N;
    vector<int> elemek;
    cin>>szamok[0];
    elemek.push_back(0);
    for(int i =1; i<N; i++){
        cin>>szamok[i];
        if(szamok[i]<szamok[i-1]){
            elemek.push_back(elemek[i-1]+1);
        }
        else {elemek.push_back(elemek[i-1]);}
    }
    cin>>Y;
    for(int i=0; i<Y; i++){
      cin>>a>>b;
      if(elemek[b-1]-elemek[a-1]>1){
        cout<<"NE";
      }
      else cout<<"DA";
    }

    return 0;
}