#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
#define dbg(x) cout << (x) << "\n"

int main()
{
    ll n, q;
    int i, x, brojac;
    cin >> n;
    vector <int > arr;
    for(int i = 0 ;i < n; i++){
        cin >> x;
        arr.push_back(x);
    }
    cin >> q;
    while(q--){
        int r, q;
        vector <int> v = arr;
        cin >> r >> q;
        int set1 = set<int>( &v[r-1], &v[q-1] ).size();
        brojac = q - r - set1;
        if(brojac == 0)
            cout << "DA" << endl;
        else
            cout << "NE" << endl;

    }

    return 0;
}