#include <cstdio>
#include <algorithm>
#include <cstring>
using namespace std;

typedef long long i64;
const int MOD = 1000000007;

int N, M, go[20];
i64 f[1 << 15], bin[300];

void update(i64 &x, i64 y) {
  x = (x + y) % MOD;
}

int main() {
  scanf("%d%d", &N, &M);
  
  for (int i = 1; i <= M; ++i) {
    int u, v;
    scanf("%d%d", &u, &v);
    u = N - u, v = N - v;
    go[u] |= 1 << v;
  }
  
  bin[0]= 1;
  for (int i = 1; i <= M; ++i) bin[i] = (bin[i - 1] + bin[i - 1]) % MOD;
  
  int S = (1 << N) - 1;
  
  for (int mask = 1; mask <= S; ++mask) {
    int f1 = (mask >> N - 1) & 1, f2 = (mask >> N - 2) & 1;
    if (f1 ^ f2) continue;
    
    f[mask] = 1;
    for (int U = (mask - 1) & mask; U; U = (U - 1) & mask) {
      int T = mask ^ U;
      f1 = (T >> N - 1) & 1, f2 = (T >> N - 2) & 1;
      if (f1 ^ f2) continue;
      i64 way = 1;
      for (int i = 0; i < N; ++i)
	if ((T >> i) & 1) way = way * (bin[__builtin_popcount(go[i] & U)] - 1) % MOD;
	else if ((U >> i) & 1) way = way * bin[__builtin_popcount(go[i] & T)] % MOD;
      update(f[mask], f[T] * way % MOD);
    }
  }

  printf("%lld\n", (bin[M] - f[S] + MOD) % MOD);
  return 0;
}
