#include <iostream>
#include <cstring>
using namespace std;
int main() {
char whereToSearch[100], whatINeed[100], foundIt[100] = {0};
cin.getline(whereToSearch, 100);
cin.getline(whatINeed, 100);
int i = 0, x = 0, n = strlen(whereToSearch), m = strlen(whatINeed);
for (int j = 0; j < m; ++j) {
for (; i < n; ++i) {
if (whatINeed[j] == whereToSearch[i]) {
foundIt[j] = whereToSearch[i];
x = i;
++i;
break;
} else if (i - x != 1 && foundIt[j] > 0) {
j = 0;
x = 0;
break;
}
}
}
int cons = 0;
for (int i = 0; i < m; ++i) {
if (foundIt[i] == whatINeed[i]) {
++cons;
}
}
if (cons == m) {
cout << "DA";
} else {
cout << "NU";
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y3N0cmluZz4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBtYWluKCkgewoJY2hhciB3aGVyZVRvU2VhcmNoWzEwMF0sIHdoYXRJTmVlZFsxMDBdLCBmb3VuZEl0WzEwMF0gPSB7MH07CgljaW4uZ2V0bGluZSh3aGVyZVRvU2VhcmNoLCAxMDApOwoJY2luLmdldGxpbmUod2hhdElOZWVkLCAxMDApOwoJaW50IGkgPSAwLCB4ID0gMCwgbiA9IHN0cmxlbih3aGVyZVRvU2VhcmNoKSwgbSA9IHN0cmxlbih3aGF0SU5lZWQpOwoJZm9yIChpbnQgaiA9IDA7IGogPCBtOyArK2opIHsKCQlmb3IgKDsgaSA8IG47ICsraSkgewoJCQlpZiAod2hhdElOZWVkW2pdID09IHdoZXJlVG9TZWFyY2hbaV0pIHsKCQkJCWZvdW5kSXRbal0gPSB3aGVyZVRvU2VhcmNoW2ldOwoJCQkJeCA9IGk7CgkJCQkrK2k7CgkJCQlicmVhazsKCQkJfSBlbHNlIGlmIChpIC0geCAhPSAxICYmIGZvdW5kSXRbal0gPiAwKSB7CgkJCQlqID0gMDsKCQkJCXggPSAwOwoJCQkJYnJlYWs7CgkJCX0KCQl9Cgl9CglpbnQgY29ucyA9IDA7Cglmb3IgKGludCBpID0gMDsgaSA8IG07ICsraSkgewoJCWlmIChmb3VuZEl0W2ldID09IHdoYXRJTmVlZFtpXSkgewoJCQkrK2NvbnM7CgkJfQoJfQoJaWYgKGNvbnMgPT0gbSkgewoJCWNvdXQgPDwgIkRBIjsKCX0gZWxzZSB7CgkJY291dCA8PCAiTlUiOwoJfQoJcmV0dXJuIDA7Cn0=