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

using ll = long long;
using vl = vector<ll>;
using vi = vector<int>;

#define rng(i, a, b) for(int i = (a); i < (b); ++i)
#define rep(n) for(int _ = 0, __ = (int)n; _ < __; _++)
#define stp(i, a, b, c) for (int i = (a); i < (b); i += (c))
#define FOR(x, cont) for (auto &x: cont)
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define eb emplace_back
#define SZ(x) (int)(x).size()
#define pq(T,COMP) priority_queue<T, vector<T>, COMP>
auto bet = [](const ll x, const ll y, const ll i) {
    return x <= i && i <= y;
};
using pii = pair<int,int>;
using vb = vector<bool>;

vi get_prime(int n) {
    vi minp(n+1);
    vi p;
    for (int i = 2; i <= n; i++) {
        if (!minp[i]) {
            minp[i] = i;
            p.pb(i);
        }
        FOR(x, p) {
            if (x <= minp[i] && x * i <= n)
                minp[x * i] = x;
        }
    }
    return p;
}

const int mod = 1e9 + 7;

void add_mod(ll &x, const ll &y) {
    x += y;
    if (x >= mod) x -= mod;
}
void sub_mod(ll &x, const ll &y) {
    x -= y;
    if (x < 0) x += mod;
}


// AGC028 D Chords
ll dp[605][605];
pii c[605][605];

int main() {
#ifdef LOCAL
    freopen("main.in", "r", stdin);
#endif
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int n, k;
    cin >> n >> k;
    vl g(2 * n + 1);
    g[0] = 1;
    for (int i = 2; i <= 2 * n; i += 2) {
        g[i] = g[i - 2] * (i - 1) % mod;
    }
    vector<pair<int, int>> a;
    rep(k) {
        int x, y;
        cin >> x  >> y;
        a.eb(x, y);
    }
    auto check = [&a](int x, int y) {
        int c1 = 0, c2 = 0;
        FOR(i, a) {
            if (bet(x, y, i.first) && bet(x, y, i.second)) c1 += 2;
            else if (!bet(x, y, i.first) && !bet(x, y, i.second)) c2 += 2;
            else return make_pair(-1, -1);
        }
        return make_pair(c1, c2);
    };



    rng (i, 1, 2 * n) stp(j, i + 1, 2 * n + 1, 2){
            c[i][j] = check(i, j);
            auto &x = c[i][j];
            if (x.first != -1) {
//                int l1 = j - i + 1, l2 = 2 * n - l1;
//                cout << i << ' ' << j << ' ' << x.first << ' ' << x.second << endl;
//                assert(l1 - x.first >= 0);
//                assert(l2 - x.second >= 0);

                dp[i][j] = g[j - i + 1 - x.first];
//                if (i == 1 && j == 4) cout << "DEBUG: " << dp[i][j] << endl;
                stp (k, i + 1, j, 2) {
                    if (dp[i][k]) {
//                        if (i==1 && j == 4) {
//                            cout << "DEBUG: " << i << ' ' << k << ' ' << dp[i][k] << endl;
//                        }
                        auto y = check(k + 1, j);
//                        assert(y.first != -1);
                        sub_mod(dp[i][j], dp[i][k] * g[j - k - y.first] % mod);
                    }
                }
            }
        }

    ll ans = 0;
//    rng (i, 1, 2 * n) rng (j, i + 1, 2 * n + 1) {
//        if (dp[i][j]) cout << i << ' ' << j << ' ' << dp[i][j] << endl;
//    }
    rng (i, 1, 2 * n) stp (j, i + 1, 2 * n + 1, 2) {
        if (dp[i][j]) add_mod(ans, dp[i][j] * g[2 * n - (j - i + 1) - c[i][j].second] % mod);
    }

    cout << ans << '\n';
    return 0;
}

Measured memory_bytes: 5888