#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <cmath>
#include <iomanip>
#include <stack>
#include <queue>
#include <numeric>
#include <map>
#include <unordered_map>
#include <set>
#include <fstream>
#include <chrono>
#include <random>
#include <bitset>
//#include <atcoder/all>
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define sz(x) ((int)(x).size())
#define pb push_back
using ll = long long;
using namespace std;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
ll gcd(ll a, ll b) {return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) {return a/gcd(a,b)*b;}

const int inf = 1e9;

int N,M;
int e[20][20];
vector<int> dp;
vector<int> ok;


int perf(int S){
  rep(i,N){
    rep(j,N){
      if(i==j) continue;
      if((S&(1<<i))!=0 && (S&(1<<j))!=0){
        if(e[i][j]==0){
          return 0;
        }
      }
    }
  }
  return 1;
}

int main(){
  cin >> N >> M;
  vector<int> A(M), B(M);
  rep(i,M){
    cin >> A[i] >> B[i];
    A[i]--; B[i]--;
    e[A[i]][B[i]] = e[B[i]][A[i]] = 1;
  }
  dp.assign(1<<N, inf);
  rep(i,1<<N){
    if(perf(i)) dp[i] = 1;
  }
  rep(i,1<<N){
    for(int j=i;--j&=i;){
      chmin(dp[i], dp[i-j]+dp[j]);
    }
  }
  cout << dp.back() << endl;
  return 0;
}

#include <bits/stdc++.h>
using namespace std;

using ll = long long;
using vb = vector<bool>;
using vi = vector<int>;
using vll = vector<long long>;
using pll = pair<long long, long long>;

int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

constexpr long long mod = 1000000007;

#define rep(i, n) for (ll i = 0; i < n; i++)
#define repi(i, a, b) for (ll i = a; i < b; i++)

#define all(x) (x).begin(), (x).end()


long long _mod_pow(long long x, long long n, long long p){
    long long res=1;
    while(n>0){
        if(n&1) res=res*x%p;
        x=x*x%p;
        n>>=1;
    }
    return res;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);

    ll n, m;
    cin >> n >> m;

    ll t = _mod_pow(10, n, m * m);

    t = (t / m) % m;
    cout << t << endl;

}
