import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;

public class Euler646 {
    static final long kMod = 1000000007L;

    static class Factor {
        int p, a;

        Factor(int p, int a) {
            this.p = p;
            this.a = a;
        }
    }

    static class Elem {
        BigInteger v;
        long w;

        Elem(BigInteger v, long w) {
            this.v = v;
            this.w = w;
        }
    }

    static ArrayList<Integer> primesUpto(int n) {
        byte[] is_prime = new byte[n + 1];
        for (int i = 0; i <= n; i++)
            is_prime[i] = 1;
        if (n >= 0)
            is_prime[0] = 0;
        if (n >= 1)
            is_prime[1] = 0;
        for (int p = 2; (long) p * p <= n; ++p) {
            if (is_prime[p] == 1) {
                for (int m = p * p; m <= n; m += p)
                    is_prime[m] = 0;
            }
        }
        ArrayList<Integer> primes = new ArrayList<>();
        for (int i = 2; i <= n; ++i) {
            if (is_prime[i] == 1)
                primes.add(i);
        }
        return primes;
    }

    static ArrayList<Factor> factorialFactors(int n) {
        ArrayList<Factor> out = new ArrayList<>();
        ArrayList<Integer> primes = primesUpto(n);
        for (int p : primes) {
            int a = 0;
            for (int x = n; x > 0; x /= p)
                a += x / p;
            out.add(new Factor(p, a));
        }
        return out;
    }

    static long modMul(long a, long b) {
        return (a * b) % kMod;
    }

    static void genDivs(ArrayList<Factor> fac, int idx, BigInteger cap, BigInteger v, long w, ArrayList<Elem> out) {
        if (idx == fac.size()) {
            out.add(new Elem(v, w));
            return;
        }
        int p = fac.get(idx).p;
        int a = fac.get(idx).a;
        long negp = (kMod - (long) p % kMod) % kMod;
        BigInteger vv = v;
        long ww = w;
        BigInteger bigP = BigInteger.valueOf(p);
        for (int e = 0; e <= a; ++e) {
            genDivs(fac, idx + 1, cap, vv, ww, out);
            if (e == a)
                break;
            if (vv.compareTo(cap.divide(bigP)) > 0)
                break;
            vv = vv.multiply(bigP);
            ww = modMul(ww, negp);
        }
    }

    static long prefixSum(BigInteger X, ArrayList<Elem> A, ArrayList<Elem> B, long[] prefB) {
        int j = B.size();
        long ans = 0;
        for (Elem a : A) {
            if (a.v.compareTo(X) > 0)
                break;
            BigInteger lim = X.divide(a.v);
            while (j > 0 && B.get(j - 1).v.compareTo(lim) > 0)
                --j;
            ans += modMul(a.w, prefB[j]);
            ans %= kMod;
        }
        return ans;
    }

    static long sFactorialBounded(int n, BigInteger L, BigInteger H) {
        ArrayList<Factor> fac = factorialFactors(n);
        int split = Math.min(5, fac.size());
        ArrayList<Factor> fa = new ArrayList<>(fac.subList(0, split));
        ArrayList<Factor> fb = new ArrayList<>(fac.subList(split, fac.size()));

        ArrayList<Elem> A = new ArrayList<>();
        ArrayList<Elem> B = new ArrayList<>();

        genDivs(fa, 0, H, BigInteger.ONE, 1, A);
        genDivs(fb, 0, H, BigInteger.ONE, 1, B);

        Comparator<Elem> cmp = new Comparator<Elem>() {
            public int compare(Elem x, Elem y) {
                return x.v.compareTo(y.v);
            }
        };

        Collections.sort(A, cmp);
        Collections.sort(B, cmp);

        long[] prefB = new long[B.size() + 1];
        for (int i = 0; i < B.size(); ++i) {
            prefB[i + 1] = (prefB[i] + B.get(i).w) % kMod;
        }

        long sumH = prefixSum(H, A, B, prefB);
        BigInteger Lm1 = L.subtract(BigInteger.ONE);
        long sumL = (L.compareTo(BigInteger.ONE) <= 0) ? 0 : prefixSum(Lm1, A, B, prefB);
        return (sumH + kMod - sumL) % kMod;
    }

    public static String solve() {
        BigInteger L = BigInteger.TEN.pow(20);
        BigInteger H = BigInteger.TEN.pow(60);
        long ans = sFactorialBounded(70, L, H);
        return Long.toString(ans);
    }

    public static void main(String[] args) {
        System.out.println(solve());
    }
}
