import std.algorithm, std.container, std.conv, std.math, std.range, std.typecons, std.stdio, std.string;

auto rdsp(){return readln.splitter;}
void pick(R,T)(ref R r,ref T t){t=r.front.to!T;r.popFront;}
void readV(T...)(ref T t){auto r=rdsp;foreach(ref v;t)pick(r,v);}

void main()
{
  int n, m; readV(n, m);

  auto g = new bool[][](n, n);
  foreach (_; 0..m) {
    int a, b; readV(a, b); --a; --b;
    g[a][b] = g[b][a] = true;
  }

  auto ans = 0;
 loop: foreach (r; iota(1, n).permutations) {
    if (!g[0][r[0]]) continue;
    foreach (i; 0..n-2)
      if (!g[r[i]][r[i+1]]) continue loop;
    ++ans;
  }

  writeln(ans);
}
