#include <bits/stdc++.h>

using namespace std;

int n, a[200005], q, l, r, br, anoii[200005], brii = 1, prvagrupa, drugagrupa, dupl;
int start = 1, finish, mid, kraj, poc;
bool gotovo;

int main () {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    cin >> n;
    for (int i = 1; i <= n; i++) {
         cin >> a[i];
         if (a[i-1] > a[i]) {
             anoii[brii] = i;
             brii++;
         }
    }
    cin >> q;

    while (q--){
         dupl = 0;
         br = 0;
         gotovo = 0;
         start = 1;
         finish = brii;
         kraj = 0;
         poc = 0;
         cin >> l >> r;
         //trazi kraj
         while (1 < 2) {
               //cout << "a" << endl;
               mid = (start + finish) / 2;

               if (anoii[mid] < r) {
                   if (anoii[mid+1] > r || anoii[mid+1] == 0) {
                       kraj = mid;
                       break;
                   }
                   else if (anoii[mid+1] == r) {
                       kraj = mid + 1;
                       break;
                   }
                   else start = mid + 1;
               }
               else if (anoii[mid] > r) {
                   if (anoii[mid-1] == 0) {
                       cout << "DA" << endl;
                       gotovo = 1;
                       break;
                   }
                   else if (anoii[mid-1] <= r) {
                       kraj = mid-1;
                       break;
                   }
                   else finish = mid - 1;
               }
               else {
                    kraj = mid;
                    break;
               }
         }
         //trazi poc
         if (gotovo == 0) {
             start = 1;
             finish = brii;
             while (1 < 2) {
                   //cout << "b" << endl;
                   mid = (start + finish) / 2;

                   if (anoii[mid]<l) {
                       if (anoii[mid+1] >= l) {
                           poc = mid+1;
                           break;
                       }
                       else if (anoii[mid+1] == 0) {
                            cout << "DA" << endl;
                            gotovo = 1;
                            break;
                       }
                       else start = mid + 1;
                   }
                   else if (anoii[mid]>l) {
                       if (anoii[mid-1] < l) {
                           poc = mid;
                           break;
                       }
                       else if (anoii[mid-1] == l) {
                           poc = mid - 1;
                           break;
                       }
                       else finish = mid - 1;
                   }
                   else {
                       poc = mid;
                       break;
                   }
             }
         }


         if (gotovo == 0) {
             //trazi poc i kraj za anoi
             //cout << poc << " " << kraj << endl;
             prvagrupa = kraj - poc + 1;
             drugagrupa = prvagrupa;
             if (anoii[poc] == l) drugagrupa--;
             if (anoii[kraj+1] - 1 == r) drugagrupa++;

             for (int i = 1; i <= kraj - poc; i++) {
                  if (anoii[i+1] - anoii[i] == 1) {
                      dupl++;
                      if (dupl >= 2) break;
                  }
             }

             //cout << prvagrupa << " " << drugagrupa << endl;

             if (prvagrupa >= 2 && drugagrupa >= 2) {
                 if ((r - l) == 1) cout << "DA" << endl;
                 else if (dupl < 2) cout << "DA" << endl;
                 else cout << "NE" << endl;
             }
             else cout << "DA" << endl;
         }

    }



return 0;
}