#include <iostream>
using namespace std;
int main(){
int n, m, rez = false;
cin >> n >> m;
for(int i=0 ; i<10 ; ++i){
int x = n, y = m , cx = 0, cy = 0;
while(x){
if(x%10 == i)
cx = 1;
x /= 10;
}
while(y){
if(y%10 == i)
cy = 1;
y /= 10;
}
if(cx * cy)
rez = 1;
}
cout << (rez ? "DA" : "NU");
return 0;
}