def main(): import sys input = sys.stdin.readline N, K = map(int, input().split()) P = list(map(int, input().split())) LV = K.bit_length() dist = [[0] * LV for _ in range(N)] for i in range(N): dist[i][0] = P[i] for lv in range(1, LV): for i in range(N): j = (i + dist[i][lv-1])%N dist[i][lv] = dist[i][lv-1] + dist[j][lv-1] for i in range(N): ans = i j = i for lv in range(LV): if K >> lv& 1: ans += dist[j][lv] j = ans % N print(ans + 1) if __name__ == '__main__': main()