#include <iostream>
#include <string>
#include <cmath>
#include <vector>
#include <algorithm>
#include <sstream>

using namespace std;

int main()
{
    int n,q,cnt = 0;
    cin >> n;
    vector<int> arr;
    for (int i = 0; i < n; i++)
    {
        int a;
        cin >> a;
        arr.push_back(a);
    }
    cin >> q;
    for (int i = 0; i < q; i++)
    {
        int a,b;
        cin >> a>> b;
        a -=1;
        b-=1;
        for (int j = 0; j < b-a; j++)
        {
            if (arr[a] > arr[a+1])
            {
                cnt++;
                a+=2;
            }
            else{
                a++;
            }
            
        }
        if (cnt < 2)
        {
            cout << "DA" << endl;
        }
        else{
            cout << "NE" << endl;
        }
        cnt = 0;
    } 
}