There are N people, conveniently numbered 1 through N.
We want to divide them into some number of groups, under the following two conditions:
 - Every group contains between A and B people, inclusive.
 - Let F_i be the number of the groups containing exactly i people. Then, for all i, either F_i=0 or C≤F_i≤D holds.
Find the number of these ways to divide the people into groups.
Here, two ways to divide them into groups is considered different if and only if there exists two people such that they belong to the same group in exactly one of the two ways.
Since the number of these ways can be extremely large, print the count modulo 10^9+7.

-----Constraints-----
 - 1≤N≤10^3
 - 1≤A≤B≤N
 - 1≤C≤D≤N

-----Input-----
The input is given from Standard Input in the following format:
N A B C D

-----Output-----
Print the number of ways to divide the people into groups under the conditions, modulo 10^9+7.

-----Sample Input-----
3 1 3 1 2

-----Sample Output-----
4

There are four ways to divide the people:
 - (1,2),(3)
 - (1,3),(2)
 - (2,3),(1)
 - (1,2,3)
The following way to divide the people does not count: (1),(2),(3). This is because it only satisfies the first condition and not the second.

```python

USER_FILENAME = "<user_code>"
import sys, json, builtins
import math, heapq, bisect, itertools, functools, collections, statistics, fractions, decimal, operator, array, random, re, string, os, pathlib
try:
    import resource as _res
except Exception:
    _res = None
from collections import Counter, defaultdict, deque, OrderedDict
from functools import lru_cache, reduce
from itertools import accumulate, permutations, combinations, product
from math import gcd, ceil, floor, sqrt
from decimal import Decimal
try:
    from typing import *
except Exception:
    pass
try:
    sys.setrecursionlimit(1_000_000)
except Exception:
    pass
try:
    import site as _site
    try:
        _sys_sites = _site.getsitepackages() if hasattr(_site, "getsitepackages") else []
        for _p in _sys_sites:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
    try:
        _usp = _site.getusersitepackages()
        if isinstance(_usp, str):
            _usp = [_usp]
        for _p in _usp:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
except Exception:
    pass

ns = {"__name__": "__main__"}
for _k, _v in list(globals().items()):
    if not _k.startswith("_"):
        ns[_k] = _v
_CODE = 'import sys\nsys.setrecursionlimit(1000000)\n\nMOD = 10**9 + 7\n\ndef ex_euclid(a,b,c,d):\n    if (b == 1) : return d\n    x = a // b\n    y = a % b\n    return ex_euclid(b,y,d,(c[0]-x*d[0],c[1]-x*d[1]))\n    \n \ndef mod_inv(a,p):\n    x = ex_euclid(p,a,(1,0),(0,1))\n    return x[1] % p\n\nn,a,b,c,d = map(int,input().split())\n\ngp = b-a+1\n\ndp = [[-1 for j in range(n+1)] for i in range(gp)]\n\ntb1=[0,1]\ntb2=[1] #便宜上0の逆元は0にする\nfor i in range(2,n+1):\n    tb1.append((tb1[i-1]*i) % MOD)\nfor i in range(1,n+1):\n    tb2.append(mod_inv(tb1[i],MOD))\n    \n\nfor i in range(gp):dp[i][0] = 1\n\n\ndef dfs(sum,k):\n    summ = sum\n    if(k < 0):\n        if (sum != 0):return 0\n        else : return 1\n    if dp[k][sum] != -1: return dp[k][sum]\n    kk = k+a\n    temp = dfs(sum,k-1)\n    temp1 = 1\n    for i in range(c-1):\n        if (sum < 0):break\n        temp1 = (temp1 * tb1[sum] * tb2[sum-kk]*tb2[kk]) % MOD \n        sum -= kk\n    for i in range(c,d+1):\n        if(sum-kk < 0) : break\n        temp1 = (temp1 * tb1[sum] * tb2[sum-kk]*tb2[kk]) % MOD\n        sum -= kk\n        temp = (temp + temp1*dfs(sum,k-1)*tb2[i]) % MOD\n\n    dp[k][summ] = temp\n    return temp\n    \n\n        \nans = dfs(n,gp-1)\n\n\n\nprint(ans)'
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 13577