program one_stroke_path
  integer :: n, m, i, k
  integer :: a(50), b(50), c
  logical :: v(8)
  a = 0
  b = 0
  c = 0
  v = .true.
  read(*,*) n, m
  if (m.lt.n-1) then
    write(*,'(i0)') 0
    stop
  end if
  do i = 1, m
    read(*,*) a(i), b(i)
  end do
  v(1) = .false.
  call dfs(n,m,a(1:m),b(1:m),v(1:n),c,1)
  write(*,'(i0)') c
  stop
contains
  recursive subroutine dfs(n,m,x,y,v,c,i)
    implicit none
    integer, intent(in)    :: n, m, x(m), y(m), i
    logical, intent(inout) :: v(n)
    integer, intent(inout) :: c
    integer                :: j
    logical                :: t
    t = .false.
    do j = 1, n
      t = t.or.v(j)
    end do
    if (.not.t) then
      c = c + 1
      return
    end if
    do j = 1, m
      if (x(j).eq.i.and.v(y(j))) then
        v(y(j)) = .false.
        call dfs(n,m,x,y,v,c,y(j))
        v(y(j)) = .true.
      end if
      if (y(j).eq.i.and.v(x(j))) then
        v(x(j)) = .false.
        call dfs(n,m,x,y,v,c,x(j))
        v(x(j)) = .true.
      end if
    end do
    return
  end subroutine dfs
end program one_stroke_path