#include <iostream>
using namespace std;

const int MAX_SIZE = 10;

int main() {
	int n, v[MAX_SIZE + 1], w[MAX_SIZE + 1];
	cin >> n;
	for (int i = 1; i <= n; ++i) {
		cin >> v[i];
	}
	for (int i = 1; i <= n; ++i) {
		cin >> w[i];
	}
	int count = 0;
	for (int i = 1; i <= n; ++i) {
		for (int j = 1; j <= n; ++j) {
			if (v[i] == w[j] && i == j) {
				count = 1;
				i = n + 1;
				j = n + 1;
			}
		}
	}
	if (count == 0) {
		cout << "DA";
	} else {
		cout << "NU";
	}
	return 0;
}