import std.stdio, std.string, std.conv;
import std.range, std.algorithm, std.array, std.typecons, std.container;
import std.math, std.numeric, core.bitop;

enum inf = 1_001_001_001;
enum inf6 = 1_001_001_001_001_001_001L;
enum mod = 1_000_000_007L;



void main() {
    int n;
    scan(n);
    auto a = readln.split.to!(int[]);

    int[int] c;
    foreach (ai ; a) {
        int b = ai;
        for (int j = 2; j*j <= ai; j++) {
            int t;
            while (b % j == 0) {
                t++;
                b /= j;
            }
            if (j in c) c[j] = max(c[j], t);
            else c[j] = t;
        }
        if (b > 1) {
            if (b in c) c[b] = max(c[b], 1);
            else c[b] = 1;
        }
    }

    debug {
        writeln(c);
    }

    long M = 1;
    foreach (k, v ; c) {
        (M *= k^^v) %= mod;
    }

    long ans;

    foreach (ai ; a) {
        auto b = M * powmod(ai, mod - 2) % mod;
        (ans += b) %= mod;
    }

    writeln(ans);
}


long powmod(int x, int y) {
    return y > 0 ? powmod(x, y>>1)^^2 % mod * x^^(y&1) % mod : 1;
}















void scan(T...)(ref T args) {
    import std.stdio : readln;
    import std.algorithm : splitter;
    import std.conv : to;
    import std.range.primitives;

    auto line = readln().splitter();
    foreach (ref arg; args) {
        arg = line.front.to!(typeof(arg));
        line.popFront();
    }
    assert(line.empty);
}

void fillAll(R, T)(ref R arr, T value) {
    static if (is(typeof(arr[] = value))) {
        arr[] = value;
    }
    else {
        foreach (ref e; arr) {
            fillAll(e, value);
        }
    }
}

bool chmin(T, U...)(ref T x, U args) {
    bool isChanged;

    foreach (arg; args) {
        if (x > arg) {
            x = arg;
            isChanged = true;
        }
    }

    return isChanged;
}

bool chmax(T, U...)(ref T x, U args) {
    bool isChanged;

    foreach (arg; args) {
        if (x < arg) {
            x = arg;
            isChanged = true;
        }
    }

    return isChanged;
}
