#include<iostream>
#include<sstream>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<algorithm>
#include<numeric>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<cassert>

#define rep(i,n) for(int i=0;i<n;i++)
#define all(c) (c).begin(),(c).end()
#define mp make_pair
#define pb push_back
#define rp(i,c) rep(i,(c).size())
#define fr(i,c) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)
#define dbg(x) cerr<<#x<<" = "<<(x)<<endl

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pi;
const int inf=1<<28;
const double INF=1e12,EPS=1e-9;

int n,m,a[1000];

int main()
{
	while(cin>>n>>m,n){
		rep(i,n)cin>>a[i];
		
		int t=inf, d=0, ans=-1;
		
		rep(i,n-1){
			
			for(int j=0;j*a[i]<=m;j++){
				if(t<j*a[i]||t==j*a[i]&&d<=a[i]){
					
					if(t==j*a[i]&&d==a[i])ans=n-1;
					
					goto NEXT;
				}
			}
			
			t=m/a[i]*a[i]; d=a[i];
			ans=i;
			
			NEXT:;
			
		}
		
		if(ans!=n-1){
			for(int j=0;j*a[n-1]<=m;j++){
				if(t<j*a[n-1]||t==j*a[n-1]&&d<a[n-1]){
					goto END;
				}
			}
			ans=n-1;
			END:;
		}
		
		cout<<ans+1<<endl;
	}
	
	return 0;
}