/*
HDU 2444 The Accomodation of Students
*/
#include<iostream>
#include<string.h>
#include<vector>
using namespace std;
#define MAXN 202
vector<int>EV[MAXN];
int linker[MAXN];
bool used[MAXN];
int uN;
int matchs[MAXN],cnt[MAXN];
bool dfs(int u)
{
int i;
for(i=0;i<EV[u].size();i++)
{
int v=EV[u][i];
if(!used[v])
{
used[v]=true;
if(linker[v]==-1||dfs(linker[v]))
{
linker[v]=u;
return true;
}
}
}
return false;
}
int hungary()
{
int res=0;
int u;
memset(linker,-1,sizeof(linker));
for(u=1;u<=uN;u++)
{
memset(used,false,sizeof(used));
if(dfs(u)) res++;
}
return res;
}
bool judge(int x,int y)
{
int i;
for(i=0;i<EV[x].size();i++)
{
if(cnt[EV[x][i]]==0)
{
cnt[EV[x][i]]=-1*y;
matchs[EV[x][i]]=true;
if(!judge(EV[x][i],-1*y)) return false;
}
else if(cnt[EV[x][i]]==y) return false;
}
return true;
}
bool matched()
{
int i;
memset(matchs,false,sizeof(matchs));
for(i=1;i<=uN;i++)
{
if(EV[i].size()&&!matchs[i])
{
memset(cnt,0,sizeof(cnt));
cnt[i]=-1;
matchs[i]=true;
if(!judge(i,-1)) return false;
}
}
return true;
}
int main()
{
int m;
int i;
int u,v;
while(scanf("%d%d",&uN,&m)!=EOF)
{
for(i=1;i<=uN;i++)
if(EV[i].size()) EV[i].clear();
while(m--)
{
scanf("%d%d",&u,&v);
EV[u].push_back(v);
EV[v].push_back(u);
}
if(matched())
printf("%d\n",hungary()/2);
else printf("No\n");
}
return 0;
}