#include <stdio.h>
#include <algorithm>
#include <vector>
using namespace std;
const int MAXN = 1e3 + 5;
vector<int> adj[MAXN];
int N, M, vis[MAXN], sz;
int dfs(int u){
vis[u] = 1, sz++;
int c = 0;
for(auto it : adj[u]){
c++;
if(!vis[it]) c += dfs(it);
}
return c;
}
int main(){
#ifdef DEBUG
freopen("input.txt", "r", stdin);
#endif
scanf("%d %d", &N, &M);
while(M--){
int x, y;
scanf("%d %d", &x, &y);
adj[x].push_back(y);
adj[y].push_back(x);
}
int cnt = 0, complete = 0;
for(int i=1; i<=N; ++i){
if(!vis[i]){
cnt++, sz = 0;
int x = dfs(i);
if(x / 2 == sz * (sz - 1) / 2) complete++;
}
}
if((complete == 1 && cnt == 1) || (complete == 2 && cnt == 2)) puts("DA");
else puts("NE");
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxhbGdvcml0aG0+CiNpbmNsdWRlIDx2ZWN0b3I+CiAKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmNvbnN0IGludCBNQVhOID0gMWUzICsgNTsKIAp2ZWN0b3I8aW50PiBhZGpbTUFYTl07CmludCBOLCBNLCB2aXNbTUFYTl0sIHN6OwogCmludCBkZnMoaW50IHUpewogIHZpc1t1XSA9IDEsIHN6Kys7CiAgaW50IGMgPSAwOwogIGZvcihhdXRvIGl0IDogYWRqW3VdKXsKICAgIGMrKzsKICAgIGlmKCF2aXNbaXRdKSBjICs9IGRmcyhpdCk7CiAgfQogIHJldHVybiBjOwp9CiAgICAKaW50IG1haW4oKXsKI2lmZGVmIERFQlVHCiAgZnJlb3BlbigiaW5wdXQudHh0IiwgInIiLCBzdGRpbik7CiNlbmRpZgogIHNjYW5mKCIlZCAlZCIsICZOLCAmTSk7CiAgd2hpbGUoTS0tKXsKICAgIGludCB4LCB5OwogICAgc2NhbmYoIiVkICVkIiwgJngsICZ5KTsKICAgIGFkalt4XS5wdXNoX2JhY2soeSk7CiAgICBhZGpbeV0ucHVzaF9iYWNrKHgpOwogIH0KICBpbnQgY250ID0gMCwgY29tcGxldGUgPSAwOwogIGZvcihpbnQgaT0xOyBpPD1OOyArK2kpewogICAgaWYoIXZpc1tpXSl7CiAgICAgIGNudCsrLCBzeiA9IDA7CiAgICAgIGludCB4ID0gZGZzKGkpOwogICAgICBpZih4IC8gMiA9PSBzeiAqIChzeiAtIDEpIC8gMikgY29tcGxldGUrKzsKICAgIH0KICB9CiAgaWYoKGNvbXBsZXRlID09IDEgJiYgY250ID09IDEpIHx8IChjb21wbGV0ZSA9PSAyICYmIGNudCA9PSAyKSkgcHV0cygiREEiKTsKICBlbHNlIHB1dHMoIk5FIik7CiAgcmV0dXJuIDA7Cn0=