#include #include #include using namespace std; bool is_gcd(int a, int b) { for (int i = 2; i <= min(a, b); ++i) { if (a % i == 0 && b % i == 0) { return true; } } return false; } int main() { ios::sync_with_stdio(false); int ans = 0; int steps, height; cin >> height >> steps; vector> good(height + 1, vector(height + 1)); for (int h = 1; h <= height; ++h) { for (int i = 1; i <= height; ++i) { if (is_gcd(h, i)) { good[h][i] = true; } } } vector prev(height + 1, 1); vector cur(height + 1); vector tmp{}; vector> others(height + 1, vector()); // just for index for (int i = 1; i <= height; ++i) { for (int j = 1; j <= height; ++j) { if ((i != j && !good[i][j]) || i == 1) { others[i].push_back(j); } } } const int modulo = static_cast(pow(10, 9)) + 7; for (int step = 0; step < steps - 1; ++step) { for (int cur_i = 1; cur_i <= height; ++cur_i) { int cur_sum = 0; for (int others_i : others[cur_i]) { if (step % 2 == 0) { cur_sum += prev[others_i]; } else { cur_sum += cur[others_i]; } cur_sum %= modulo; } if (step % 2 == 0) { cur[cur_i] = cur_sum; } else { prev[cur_i] = cur_sum; } } } for (int i = 1; i <= height; ++i) { ans += cur[i]; ans %= modulo; } cout << ans << endl; }