#include <bits/stdc++.h>
using namespace std;
#define _11037_ ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
#define endl '\n'
#define MAX 100005
#define MOD 998244353
int N, X, a[MAX];
int BFS(int start)
{
int book[MAX];
for (int i = 0; i < MAX; i++)
book[i] = inf;
priority_queue<pair<int, int>, vector<pair<int, int>>, greater<pair<int, int>>> que;
que.push({0, 0}), book[0] = 0;
while (que.size())
{
int nowstep = que.top().first, now = que.top().second;
if (now == X)
return book[X];
que.pop();
for (int i = 0; i < N; i++)
{
if (book[(now + a[now] + i) % N] < nowstep + i + 1)
continue;
book[(now + a[now] + i) % N] = nowstep + i + 1;
que.push({nowstep + i + 1, (now + a[now] + i) % N});
}
}
return book[X];
}
signed main()
{
_11037_
cin >> N >> X;
for (int i = 0; i < N; i++)
cin >> a[i];
cout << BFS(0) << endl;
}