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

typedef long long s64;

const int MaxN = 15;
const int MaxM = MaxN * (MaxN - 1) / 2;
const int M = 1000000007;

int n, m;
int out[MaxN];

int mul[1 << MaxN];

int f[1 << MaxN];

int main()
{
	cin >> n >> m;
	for (int i = 0; i < m; ++i)
	{
		int u, v;
		cin >> u >> v, --u, --v;

		out[u] |= 1 << v;
	}

	mul[0] = 1;
	for (int s = 1; s < 1 << n; ++s)
		mul[s] = mul[s ^ (s & -s)] << 1;

	f[0] = 1;
	for (int s = 1; s < 1 << n; ++s)
		if ((s ^ (~s >> 1)) & 1)
		{
			for (int t = s; t; --t &= s)
			{
				int v = s ^ t;

				int sum = f[v];
				for (int i = 0; i < n; ++i)
				{
					if (v >> i & 1)
						sum = (s64)sum * (mul[out[i] & t] - 1) % M;
					if (t >> i & 1)
						sum = (s64)sum * mul[out[i] & v] % M;
				}

				f[s] = (f[s] + sum) % M;
			}
		}

	int res = 1;
	for (int i = 0; i < m; ++i)
		res = res * 2 % M;

	cout << (res + M - f[(1 << n) - 1]) % M << endl;

	return 0;
}