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

using namespace std;

int main()
{


    cin.tie(0);
    int N,Y,a,b,x;
    cin>>N;

    int elemek[200001];
    int elozo;

    cin>>elozo;
    elemek[0] = 0;
    for(int i =1; i<N; i++){
        cin>>x;
        if(x<elozo){
            elemek[i]=elemek[i-1]+1;
        }
        else {elemek[i]=elemek[i-1];}
        elozo = x;
    }
    cin>>Y;
    for(int i=0; i<Y; i++){
      cin>>a>>b;

      if(elemek[b-1]-elemek[a-1]>1){
        cout<<"NE"<<endl;
      }
      else cout<<"DA"<<endl;
    }



    return 0;
}