#include <bits/stdc++.h>
#if defined(__GNUC__)
#pragma GCC optimize ("Ofast")
#endif
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<pii, int> piii;
typedef pair<ll, ll> pll;
#define debug(x) cerr<<#x<<'='<<x<<endl;
#define debugp(x) cerr<<#x<<"= {"<<x.first<<", "<<x.second<<"}"<<endl;
#define all(x) x.begin(), x.end()
#define pb push_back
#define kill(x) return cout<<x<<'\n', 0;

const ld eps=1e-7;
const int inf=1000000010;
const ll INF=10000000000000010LL;
const ll mod = 32416190071;
const int MAXN = 100010;

ll to_int(string s){
	if (s[0]=='-') return -to_int(s.substr(1, s.size()));
	ll res=0;
	for (char ch:s) res=res*10+(ch-'0');
	return res;
}

int n, m, k, u, v, x, y, t, a, b, ans;
ll A[MAXN];
bool mark[MAXN];
string s;

int main(){
	ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	cin>>n>>k;
	for (int i=0; i<=n; i++){
		cin>>s;
		if (s=="?"){
			mark[i]=1;
			t++;
		}
		else A[i]=to_int(s);
	}
	//debug(t)
	//for (int i=0; i<=n; i++) cerr<<A[i]<<' ';cerr<<endl;
	if (!t){
		for (int i=n; i; i--) A[i-1]=(A[i-1]+A[i]*k)%mod;
		if (A[0]) kill("No")
		kill("Yes")
	}
	if (k){
		if ((n+1)%2) kill("No")
		kill("Yes")
	}
	if (mark[0] && (n-t)%2 || !mark[0] && A[0]==0) kill("Yes")
	kill("No")

	return 0;
}
/*
          .---.                                                                     .---.              ...-'  |`. ..-'''-.       / .--. \        .-''-.
          |   |.--.                       .                     .                   |   |.--.          |      |  |\.-'''\ \     ' '    ' '     .' .-.  )
          |   ||__|                     .'|                   .'|                   |   ||__|          ....   |  |       | |    \ \    / /    / .'  / /
          |   |.--.                    <  |                  <  |                   |   |.--.            -|   |  |    __/ /      `.`'--.'    (_/   / /
    __    |   ||  |                     | |             __    | |             __    |   ||  |             |   |  |   |_  '.      / `'-. `.        / /
 .:--.'.  |   ||  |                 _   | | .'''-.   .:--.'.  | | .'''-.   .:--.'.  |   ||  |          ...'   `--'      `.  \   ' /    `. \      / /
/ |   \ | |   ||  |               .' |  | |/.'''. \ / |   \ | | |/.'''. \ / |   \ | |   ||  |          |         |`.      \ '. / /       \ '    . '
`" __ | | |   ||  |              .   | /|  /    | | `" __ | | |  /    | | `" __ | | |   ||  |          ` --------\ |       , || |         | |  / /    _.-')
 .'.''| | |   ||__|            .'.'| |//| |     | |  .'.''| | | |     | |  .'.''| | |   ||__|           `---------'        | || |         | |.' '  _.'.-''
/ /   | |_'---'              .'.'.-'  / | |     | | / /   | |_| |     | | / /   | |_'---'                                 / ,' \ \       / //  /.-'_.'
\ \._,\ '/                   .'   \_.'  | '.    | '.\ \._,\ '/| '.    | '.\ \._,\ '/                              -....--'  /   `.'-...-'.'/    _.'
 `--'  `"                               '---'   '---'`--'  `" '---'   '---'`--'  `"                               `.. __..-'       `-...-'( _.-'
*/


#include <bits/stdc++.h>
#if defined(__GNUC__)
#pragma GCC optimize ("Ofast")
#endif
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<pii, int> piii;
typedef pair<ll, ll> pll;
#define debug(x) cerr<<#x<<'='<<x<<endl;
#define debugp(x) cerr<<#x<<"= {"<<x.first<<", "<<x.second<<"}"<<endl;
#define all(x) x.begin(), x.end()
#define pb push_back
#define kill(x) return cout<<x<<'\n', 0;

const ld eps=1e-7;
const int inf=1000000010;
const ll INF=10000000000000010LL;
const int mod = 32416190071;
const int MAXN = 100010;

ll to_int(string s){
	if (s[0]=='-') return -to_int(s.substr(1, s.size()));
	ll res=0;
	for (char ch:s) res=res*10+(ch-'0');
	return res;
}

int n, m, k, u, v, x, y, t, a, b, ans;
ll A[MAXN];
bool mark[MAXN];
string s;

int main(){
	ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	cin>>n>>k;
	for (int i=0; i<=n; i++){
		cin>>s;
		if (s=="?"){
			mark[i]=1;
			t++;
		}
		else A[i]=to_int(s);
	}
	//debug(t)
	//for (int i=0; i<=n; i++) cerr<<A[i]<<' ';cerr<<endl;
	if (!t){
		for (int i=n; i; i--) A[i-1]=(A[i-1]+A[i]*k)%mod;
		if (A[0]) kill("No")
		kill("Yes")
	}
	if (k){
		if ((n+1)%2) kill("No")
		kill("Yes")
	}
	if (mark[0] && (n+1)%2 || !mark[0] && A[0]==0) kill("Yes")
	kill("No")

	return 0;
}
/*
          .---.                                                                     .---.              ...-'  |`. ..-'''-.       / .--. \        .-''-.
          |   |.--.                       .                     .                   |   |.--.          |      |  |\.-'''\ \     ' '    ' '     .' .-.  )
          |   ||__|                     .'|                   .'|                   |   ||__|          ....   |  |       | |    \ \    / /    / .'  / /
          |   |.--.                    <  |                  <  |                   |   |.--.            -|   |  |    __/ /      `.`'--.'    (_/   / /
    __    |   ||  |                     | |             __    | |             __    |   ||  |             |   |  |   |_  '.      / `'-. `.        / /
 .:--.'.  |   ||  |                 _   | | .'''-.   .:--.'.  | | .'''-.   .:--.'.  |   ||  |          ...'   `--'      `.  \   ' /    `. \      / /
/ |   \ | |   ||  |               .' |  | |/.'''. \ / |   \ | | |/.'''. \ / |   \ | |   ||  |          |         |`.      \ '. / /       \ '    . '
`" __ | | |   ||  |              .   | /|  /    | | `" __ | | |  /    | | `" __ | | |   ||  |          ` --------\ |       , || |         | |  / /    _.-')
 .'.''| | |   ||__|            .'.'| |//| |     | |  .'.''| | | |     | |  .'.''| | |   ||__|           `---------'        | || |         | |.' '  _.'.-''
/ /   | |_'---'              .'.'.-'  / | |     | | / /   | |_| |     | | / /   | |_'---'                                 / ,' \ \       / //  /.-'_.'
\ \._,\ '/                   .'   \_.'  | '.    | '.\ \._,\ '/| '.    | '.\ \._,\ '/                              -....--'  /   `.'-...-'.'/    _.'
 `--'  `"                               '---'   '---'`--'  `" '---'   '---'`--'  `"                               `.. __..-'       `-...-'( _.-'
*/


#include <bits/stdc++.h>
#if defined(__GNUC__)
#pragma GCC optimize ("Ofast")
#endif
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<pii, int> piii;
typedef pair<ll, ll> pll;
#define debug(x) cerr<<#x<<'='<<x<<endl;
#define debugp(x) cerr<<#x<<"= {"<<x.first<<", "<<x.second<<"}"<<endl;
#define all(x) x.begin(), x.end()
#define pb push_back
#define kill(x) return cout<<x<<'\n', 0;

const ld eps=1e-7;
const int inf=1000000010;
const ll INF=10000000000000010LL;
const int mod = 1000000007;
const int MAXN = 100010;

ll to_int(string s){
	if (s[0]=='-') return -to_int(s.substr(1, s.size()));
	ll res=0;
	for (char ch:s) res=res*10+(ch-'0');
	return res;
}

int n, m, k, u, v, x, y, t, a, b, ans;
ll A[MAXN];
bool mark[MAXN];
string s;

int main(){
	ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	cin>>n>>k;
	for (int i=0; i<=n; i++){
		cin>>s;
		if (s=="?"){
			mark[i]=1;
			t++;
		}
		else A[i]=to_int(s);
	}
	//debug(t)
	//for (int i=0; i<=n; i++) cerr<<A[i]<<' ';cerr<<endl;
	if (!t){
		for (int i=n; i; i--) A[i-1]=(A[i-1]+A[i]*k)%mod;
		if (A[0]) kill("No")
		kill("Yes")
	}
	if (k){
		if ((n+1)%2) kill("No")
		kill("Yes")
	}
	if (mark[0] || A[0]==0) kill("Yes")
	kill("No")

	return 0;
}
/*
          .---.                                                                     .---.              ...-'  |`. ..-'''-.       / .--. \        .-''-.
          |   |.--.                       .                     .                   |   |.--.          |      |  |\.-'''\ \     ' '    ' '     .' .-.  )
          |   ||__|                     .'|                   .'|                   |   ||__|          ....   |  |       | |    \ \    / /    / .'  / /
          |   |.--.                    <  |                  <  |                   |   |.--.            -|   |  |    __/ /      `.`'--.'    (_/   / /
    __    |   ||  |                     | |             __    | |             __    |   ||  |             |   |  |   |_  '.      / `'-. `.        / /
 .:--.'.  |   ||  |                 _   | | .'''-.   .:--.'.  | | .'''-.   .:--.'.  |   ||  |          ...'   `--'      `.  \   ' /    `. \      / /
/ |   \ | |   ||  |               .' |  | |/.'''. \ / |   \ | | |/.'''. \ / |   \ | |   ||  |          |         |`.      \ '. / /       \ '    . '
`" __ | | |   ||  |              .   | /|  /    | | `" __ | | |  /    | | `" __ | | |   ||  |          ` --------\ |       , || |         | |  / /    _.-')
 .'.''| | |   ||__|            .'.'| |//| |     | |  .'.''| | | |     | |  .'.''| | |   ||__|           `---------'        | || |         | |.' '  _.'.-''
/ /   | |_'---'              .'.'.-'  / | |     | | / /   | |_| |     | | / /   | |_'---'                                 / ,' \ \       / //  /.-'_.'
\ \._,\ '/                   .'   \_.'  | '.    | '.\ \._,\ '/| '.    | '.\ \._,\ '/                              -....--'  /   `.'-...-'.'/    _.'
 `--'  `"                               '---'   '---'`--'  `" '---'   '---'`--'  `"                               `.. __..-'       `-...-'( _.-'
*/


#include <bits/stdc++.h>
#if defined(__GNUC__)
#pragma GCC optimize ("Ofast")
#endif
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<pii, int> piii;
typedef pair<ll, ll> pll;
#define debug(x) cerr<<#x<<'='<<x<<endl;
#define debugp(x) cerr<<#x<<"= {"<<x.first<<", "<<x.second<<"}"<<endl;
#define all(x) x.begin(), x.end()
#define pb push_back
#define kill(x) return cout<<x<<'\n', 0;

const ld eps=1e-7;
const int inf=1000000010;
const ll INF=10000000000000010LL;
const ll mod = 32416190071;
const int MAXN = 100010;

ll to_int(string s){
	if (s[0]=='-') return -to_int(s.substr(1, s.size()));
	ll res=0;
	for (char ch:s) res=res*10+(ch-'0');
	return res;
}

int n, m, k, u, v, x, y, t, a, b, ans;
ll A[MAXN];
bool mark[MAXN];
string s;

int main(){
	ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	cin>>n>>k;
	for (int i=0; i<=n; i++){
		cin>>s;
		if (s=="?"){
			mark[i]=1;
			t++;
		}
		else A[i]=to_int(s);
	}
	//debug(t)
	//for (int i=0; i<=n; i++) cerr<<A[i]<<' ';cerr<<endl;
	if (!t){
		for (int i=n; i; i--) A[i-1]=(A[i-1]+A[i]*k)%mod;
		if (A[0]) kill("No")
		kill("Yes")
	}
	if (k){
		if ((n+1)%2) kill("No")
		kill("Yes")
	}
	if (mark[0] && (n-t+1)%2 || !mark[0] && A[0]==0) kill("Yes")
	kill("No")

	return 0;
}
/*
          .---.                                                                     .---.              ...-'  |`. ..-'''-.       / .--. \        .-''-.
          |   |.--.                       .                     .                   |   |.--.          |      |  |\.-'''\ \     ' '    ' '     .' .-.  )
          |   ||__|                     .'|                   .'|                   |   ||__|          ....   |  |       | |    \ \    / /    / .'  / /
          |   |.--.                    <  |                  <  |                   |   |.--.            -|   |  |    __/ /      `.`'--.'    (_/   / /
    __    |   ||  |                     | |             __    | |             __    |   ||  |             |   |  |   |_  '.      / `'-. `.        / /
 .:--.'.  |   ||  |                 _   | | .'''-.   .:--.'.  | | .'''-.   .:--.'.  |   ||  |          ...'   `--'      `.  \   ' /    `. \      / /
/ |   \ | |   ||  |               .' |  | |/.'''. \ / |   \ | | |/.'''. \ / |   \ | |   ||  |          |         |`.      \ '. / /       \ '    . '
`" __ | | |   ||  |              .   | /|  /    | | `" __ | | |  /    | | `" __ | | |   ||  |          ` --------\ |       , || |         | |  / /    _.-')
 .'.''| | |   ||__|            .'.'| |//| |     | |  .'.''| | | |     | |  .'.''| | |   ||__|           `---------'        | || |         | |.' '  _.'.-''
/ /   | |_'---'              .'.'.-'  / | |     | | / /   | |_| |     | | / /   | |_'---'                                 / ,' \ \       / //  /.-'_.'
\ \._,\ '/                   .'   \_.'  | '.    | '.\ \._,\ '/| '.    | '.\ \._,\ '/                              -....--'  /   `.'-...-'.'/    _.'
 `--'  `"                               '---'   '---'`--'  `" '---'   '---'`--'  `"                               `.. __..-'       `-...-'( _.-'
*/


#include <bits/stdc++.h>
#if defined(__GNUC__)
#pragma GCC optimize ("Ofast")
#endif
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<pii, int> piii;
typedef pair<ll, ll> pll;
#define debug(x) cerr<<#x<<'='<<x<<endl;
#define debugp(x) cerr<<#x<<"= {"<<x.first<<", "<<x.second<<"}"<<endl;
#define all(x) x.begin(), x.end()
#define pb push_back
#define kill(x) return cout<<x<<'\n', 0;

const ld eps=1e-7;
const int inf=1000000010;
const ll INF=10000000000000010LL;
const int mod = 1000000007;
const int MAXN = 100010;

ll to_int(string s){
	if (s[0]=='-') return -to_int(s.substr(1, s.size()));
	ll res=0;
	for (char ch:s) res=res*10+(ch-'0');
	return res;
}

int n, m, k, u, v, x, y, t, a, b, ans;
ll A[MAXN];
bool mark[MAXN];
string s;

int main(){
	ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	cin>>n>>k;
	for (int i=0; i<=n; i++){
		cin>>s;
		if (s=="?"){
			mark[i]=1;
			t++;
		}
		else A[i]=to_int(s);
	}
	//debug(t)
	//for (int i=0; i<=n; i++) cerr<<A[i]<<' ';cerr<<endl;
	if (!t){
		for (int i=n; i; i--) A[i-1]=(A[i-1]+A[i]*k)%mod;
		if (A[0]) kill("No")
		kill("Yes")
	}
	if (k){
		if ((n+1)%2) kill("No")
		kill("Yes")
	}
	if (mark[0]) kill("No")
	kill("Yes")

	return 0;
}
/*
          .---.                                                                     .---.              ...-'  |`. ..-'''-.       / .--. \        .-''-.
          |   |.--.                       .                     .                   |   |.--.          |      |  |\.-'''\ \     ' '    ' '     .' .-.  )
          |   ||__|                     .'|                   .'|                   |   ||__|          ....   |  |       | |    \ \    / /    / .'  / /
          |   |.--.                    <  |                  <  |                   |   |.--.            -|   |  |    __/ /      `.`'--.'    (_/   / /
    __    |   ||  |                     | |             __    | |             __    |   ||  |             |   |  |   |_  '.      / `'-. `.        / /
 .:--.'.  |   ||  |                 _   | | .'''-.   .:--.'.  | | .'''-.   .:--.'.  |   ||  |          ...'   `--'      `.  \   ' /    `. \      / /
/ |   \ | |   ||  |               .' |  | |/.'''. \ / |   \ | | |/.'''. \ / |   \ | |   ||  |          |         |`.      \ '. / /       \ '    . '
`" __ | | |   ||  |              .   | /|  /    | | `" __ | | |  /    | | `" __ | | |   ||  |          ` --------\ |       , || |         | |  / /    _.-')
 .'.''| | |   ||__|            .'.'| |//| |     | |  .'.''| | | |     | |  .'.''| | |   ||__|           `---------'        | || |         | |.' '  _.'.-''
/ /   | |_'---'              .'.'.-'  / | |     | | / /   | |_| |     | | / /   | |_'---'                                 / ,' \ \       / //  /.-'_.'
\ \._,\ '/                   .'   \_.'  | '.    | '.\ \._,\ '/| '.    | '.\ \._,\ '/                              -....--'  /   `.'-...-'.'/    _.'
 `--'  `"                               '---'   '---'`--'  `" '---'   '---'`--'  `"                               `.. __..-'       `-...-'( _.-'
*/


#include <bits/stdc++.h>
#if defined(__GNUC__)
#pragma GCC optimize ("Ofast")
#endif
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<pii, int> piii;
typedef pair<ll, ll> pll;
#define debug(x) cerr<<#x<<'='<<x<<endl;
#define debugp(x) cerr<<#x<<"= {"<<x.first<<", "<<x.second<<"}"<<endl;
#define all(x) x.begin(), x.end()
#define pb push_back
#define kill(x) return cout<<x<<'\n', 0;

const ld eps=1e-7;
const int inf=1000000010;
const ll INF=10000000000000010LL;
const int mod = 1000000007;
const int MAXN = 100010;

ll to_int(string s){
	if (s[0]=='-') return -to_int(s.substr(1, s.size()));
	ll res=0;
	for (char ch:s) res=res*10+(ch-'0');
	return res;
}

int n, m, k, u, v, x, y, t, a, b, ans;
ll A[MAXN];
bool mark[MAXN];
string s;

int main(){
	ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	cin>>n>>k;
	for (int i=0; i<=n; i++){
		cin>>s;
		if (s=="?"){
			mark[i]=1;
			t++;
		}
		else A[i]=to_int(s);
	}
	//debug(t)
	//for (int i=0; i<=n; i++) cerr<<A[i]<<' ';cerr<<endl;
	if (!t){
		for (int i=n; i; i--) A[i-1]=(A[i-1]+A[i]*k)%mod;
		if (A[0]) kill("No")
		kill("Yes")
	}
	if (k){
		if ((n+1)%2) kill("No")
		kill("Yes")
	}
	if (mark[0] && (n+1)%2 || !mark[0] && A[0]==0) kill("Yes")
	kill("No")

	return 0;
}
/*
          .---.                                                                     .---.              ...-'  |`. ..-'''-.       / .--. \        .-''-.
          |   |.--.                       .                     .                   |   |.--.          |      |  |\.-'''\ \     ' '    ' '     .' .-.  )
          |   ||__|                     .'|                   .'|                   |   ||__|          ....   |  |       | |    \ \    / /    / .'  / /
          |   |.--.                    <  |                  <  |                   |   |.--.            -|   |  |    __/ /      `.`'--.'    (_/   / /
    __    |   ||  |                     | |             __    | |             __    |   ||  |             |   |  |   |_  '.      / `'-. `.        / /
 .:--.'.  |   ||  |                 _   | | .'''-.   .:--.'.  | | .'''-.   .:--.'.  |   ||  |          ...'   `--'      `.  \   ' /    `. \      / /
/ |   \ | |   ||  |               .' |  | |/.'''. \ / |   \ | | |/.'''. \ / |   \ | |   ||  |          |         |`.      \ '. / /       \ '    . '
`" __ | | |   ||  |              .   | /|  /    | | `" __ | | |  /    | | `" __ | | |   ||  |          ` --------\ |       , || |         | |  / /    _.-')
 .'.''| | |   ||__|            .'.'| |//| |     | |  .'.''| | | |     | |  .'.''| | |   ||__|           `---------'        | || |         | |.' '  _.'.-''
/ /   | |_'---'              .'.'.-'  / | |     | | / /   | |_| |     | | / /   | |_'---'                                 / ,' \ \       / //  /.-'_.'
\ \._,\ '/                   .'   \_.'  | '.    | '.\ \._,\ '/| '.    | '.\ \._,\ '/                              -....--'  /   `.'-...-'.'/    _.'
 `--'  `"                               '---'   '---'`--'  `" '---'   '---'`--'  `"                               `.. __..-'       `-...-'( _.-'
*/


#include <bits/stdc++.h>
#if defined(__GNUC__)
#pragma GCC optimize ("Ofast")
#endif
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<pii, int> piii;
typedef pair<ll, ll> pll;
#define debug(x) cerr<<#x<<'='<<x<<endl;
#define debugp(x) cerr<<#x<<"= {"<<x.first<<", "<<x.second<<"}"<<endl;
#define all(x) x.begin(), x.end()
#define pb push_back
#define kill(x) return cout<<x<<'\n', 0;

const ld eps=1e-7;
const int inf=1000000010;
const ll INF=10000000000000010LL;
const int mod = 1000000007;
const int MAXN = 100010;

ll to_int(string s){
	if (s[0]=='-') return -to_int(s.substr(1, s.size()));
	ll res=0;
	for (char ch:s) res=res*10+(ch-'0');
	return res;
}

int n, m, k, u, v, x, y, t, a, b, ans;
ll A[MAXN];
bool mark[MAXN];
string s;

int main(){
	ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	cin>>n>>k;
	for (int i=0; i<=n; i++){
		cin>>s;
		if (s=="?"){
			mark[i]=1;
			t++;
		}
		else A[i]=to_int(s);
	}
	//debug(t)
	if (!t){
		for (int i=n; i; i--) A[i-1]-=A[i]*k;
		if (A[0]) kill("No")
		kill("Yes")
	}
	if (k){
		if ((n+1)%2) kill("No")
		kill("Yes")
	}
	if (mark[0]) kill("No")
	kill("Yes")

	return 0;
}
/*
          .---.                                                                     .---.              ...-'  |`. ..-'''-.       / .--. \        .-''-.
          |   |.--.                       .                     .                   |   |.--.          |      |  |\.-'''\ \     ' '    ' '     .' .-.  )
          |   ||__|                     .'|                   .'|                   |   ||__|          ....   |  |       | |    \ \    / /    / .'  / /
          |   |.--.                    <  |                  <  |                   |   |.--.            -|   |  |    __/ /      `.`'--.'    (_/   / /
    __    |   ||  |                     | |             __    | |             __    |   ||  |             |   |  |   |_  '.      / `'-. `.        / /
 .:--.'.  |   ||  |                 _   | | .'''-.   .:--.'.  | | .'''-.   .:--.'.  |   ||  |          ...'   `--'      `.  \   ' /    `. \      / /
/ |   \ | |   ||  |               .' |  | |/.'''. \ / |   \ | | |/.'''. \ / |   \ | |   ||  |          |         |`.      \ '. / /       \ '    . '
`" __ | | |   ||  |              .   | /|  /    | | `" __ | | |  /    | | `" __ | | |   ||  |          ` --------\ |       , || |         | |  / /    _.-')
 .'.''| | |   ||__|            .'.'| |//| |     | |  .'.''| | | |     | |  .'.''| | |   ||__|           `---------'        | || |         | |.' '  _.'.-''
/ /   | |_'---'              .'.'.-'  / | |     | | / /   | |_| |     | | / /   | |_'---'                                 / ,' \ \       / //  /.-'_.'
\ \._,\ '/                   .'   \_.'  | '.    | '.\ \._,\ '/| '.    | '.\ \._,\ '/                              -....--'  /   `.'-...-'.'/    _.'
 `--'  `"                               '---'   '---'`--'  `" '---'   '---'`--'  `"                               `.. __..-'       `-...-'( _.-'
*/


#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for(int i=(a); i<(b); i++)
#define per(i, a, b) for(int i=(b)-1; i>=(a); i--)
#define sz(a) (int)a.size()
#define de(a) cout << #a << " = " << a << endl
#define dd(a) cout << #a << " = " << a << " "
#define all(a) a.begin(), a.end()
#define pw(x) (1ll<<(x))
#define endl "\n"
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
const int INF = 1e9+7;
void Y(){puts("Yes");exit(0);}
void N(){puts("No");exit(0);}
ll v[1000000+10];
int main(){
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);
	int n,k;
	cin >> n >> k;
	int tmp=0;
	rep(i,0,n+1){
	    char s[12];
	    cin >> s;
	    if(s[0]=='?'){
	        v[i]=INF;
	        tmp++;
	    }
	    else v[i]=atoi(s);
	}
	if(!k){
	    if(v[0]==0) Y();
        else if(v[0]!=INF) N();
        else {
            if((n+1-tmp)%2) Y();
            else N();
        }
    }
    if(!tmp){
        ll now=0;
        for(int i=n;i>=0;i--){
            now*=k;
            now+=v[i];
            if(abs(now)>=1e14){
                N();
            }
        }
        if(!now) Y();
        else N();
    }
    else{
        if((n+1)%2==0) Y();
        else N();
    }

	return 0;
}


#include <bits/stdc++.h>
//#include <atcoder/all>
//using namespace atcoder;
const double pi = 3.141592653589793238462643383279;
using namespace std;
//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<long long, long long> PLL;
typedef pair<int, PII> TIII;
typedef long long LL;
typedef unsigned long long ULL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;

//container util
//------------------------------------------
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define SQ(a) ((a) * (a))
#define EACH(i, c) for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define EXIST(s, e) ((s).find(e) != (s).end())
#define SORT(c) sort((c).begin(), (c).end())

//repetition
//------------------------------------------
#define FOR(i, s, n) for (int i = s; i < (int)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define MOD 1000000007

#define rep(i, a, b) for (int i = a; i < (b); ++i)
#define trav(a, x) for (auto &a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()

typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
const double EPS = 1e-10, PI = acos(-1);
//ここから編集

int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);

  int n, k; cin >> n >> k;

  vector<int> a(n+1);
  if(k == 0){
    string s; cin >> s;
    if(s == "0") {
      cout << "Yes" << endl;
    }
    if(s == "?"){
      int turn = 0;
      for(int i=0; i<n; i++){
        cin >> s;
        if(s != "?") turn++;
      }
      if(turn%2 == 1) cout << "Yes" << endl;
      else cout << "No" << endl;
    }else{
      cout << "No" << endl;
    }
  }else{
    ll sum = 0;
    bool f = false;
    for(int i=0; i<n+1; i++){
      string s; cin >> s;
      if(s == "?"){
        if(n%2 == 1) cout << "Yes" << endl;
        else cout << "No" << endl;
        return 0;
      }

      if(sum % abs(k)) f = true;
      sum /= k;
      sum += stoi(s);
    }
    if(sum || f) cout << "No" << endl;
    else cout << "Yes" << endl;
  }

  return 0;
}


#include <bits/stdc++.h>
//#include <atcoder/all>
//using namespace atcoder;
const double pi = 3.141592653589793238462643383279;
using namespace std;
//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<long long, long long> PLL;
typedef pair<int, PII> TIII;
typedef long long LL;
typedef unsigned long long ULL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;

//container util
//------------------------------------------
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define SQ(a) ((a) * (a))
#define EACH(i, c) for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define EXIST(s, e) ((s).find(e) != (s).end())
#define SORT(c) sort((c).begin(), (c).end())

//repetition
//------------------------------------------
#define FOR(i, s, n) for (int i = s; i < (int)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define MOD 1000000007

#define rep(i, a, b) for (int i = a; i < (b); ++i)
#define trav(a, x) for (auto &a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()

typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
const double EPS = 1e-10, PI = acos(-1);
//ここから編集

int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);

  int n, k; cin >> n >> k;

  vector<int> a(n+1);
  if(k == 0){
    string s; cin >> s;
    if(s == "0") {
      cout << "Yes" << endl;
      return 0;
    }
    if(s == "?"){
      int turn = 0;
      for(int i=0; i<n; i++){
        cin >> s;
        if(s != "?") turn++;
      }
      if(turn%2 == 1) cout << "Yes" << endl;
      else cout << "No" << endl;
    }else{
      cout << "No" << endl;
    }
  }else{
    ll sum = 0;
    bool f = false;
    for(int i=0; i<n+1; i++){
      string s; cin >> s;
      if(s == "?"){
        if(n%2 == 1) cout << "Yes" << endl;
        else cout << "No" << endl;
        return 0;
      }

      if(sum % abs(k)) f = true;
      sum /= k;
      sum += stoi(s);
    }
    if(sum || f) cout << "No" << endl;
    else cout << "Yes" << endl;
  }

  return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define int long long
#define form2(i, a, b) for (int i = (a); i < (b); ++i)
#define ford2(i, a, b) for (int i = (a-1); i >= (b); --i)
#define form(i, n) form2(i, 0, n)
#define ford(i, n) ford2(i, n, 0)

#define chmax(x, v) x = max(x, (v))
#define chmin(x, v) x = min(x, (v))
#define fi first
#define se second

const long long BIG = 1000000000000000000LL;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;

void solve();
signed main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	solve();
	return 0;
}

const int MOD = 179424697;

void solve()
{
	int n, k; cin >> n >> k;
	int cnt = 0;
	int curPow = 1;
	int curTot = 0;
	form(i, n+1) {
		string s; cin >> s;
		if (s == "?") ++cnt;
		else { int x = stoi(s); curTot += x*curPow; curTot %= MOD; }
		curPow *= k; curPow %= MOD;
	}
	if (k == 0) {
		string s; cin >> s;
		if ((s == "?" && cnt%2 == 1) || s == "0") cout << "Yes\n";
		else cout << "No\n";
		return;
	}
	curTot += MOD; curTot %= MOD;
	if (cnt == 0) {
		if (curTot == 0) cout << "Yes\n";
		else cout << "No\n";
		return;
	}
	if (n%2 == 1) cout << "Yes\n";
	else cout << "No\n";
}


#include <bits/stdc++.h>
using namespace std;

#define int long long
#define form2(i, a, b) for (int i = (a); i < (b); ++i)
#define ford2(i, a, b) for (int i = (a-1); i >= (b); --i)
#define form(i, n) form2(i, 0, n)
#define ford(i, n) ford2(i, n, 0)

#define chmax(x, v) x = max(x, (v))
#define chmin(x, v) x = min(x, (v))
#define fi first
#define se second

const long long BIG = 1000000000000000000LL;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;

void solve();
signed main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	solve();
	return 0;
}

const int MOD = 179424697;

void solve()
{
	int n, k; cin >> n >> k;
	if (k == 0) {
		string s; cin >> s;
		if (s == "?" || s == "0") cout << "Yes\n";
		else cout << "No\n";
		return;
	}
	int cnt = 0;
	int curPow = 1;
	int curTot = 0;
	form(i, n+1) {
		string s; cin >> s;
		if (s == "?") ++cnt;
		else { int x = stoi(s); curTot += x*curPow; curTot %= MOD; }
		curPow *= k; curPow %= MOD;
	}
	curTot += MOD; curTot %= MOD;
	if (cnt == 0) {
		if (curTot == 0) cout << "Yes\n";
		else cout << "No\n";
		return;
	}
	if (cnt%2 == n%2) cout << "Yes\n";
	else cout << "No\n";
}


#include <bits/stdc++.h>
using namespace std;

#define int long long
#define form2(i, a, b) for (int i = (a); i < (b); ++i)
#define ford2(i, a, b) for (int i = (a-1); i >= (b); --i)
#define form(i, n) form2(i, 0, n)
#define ford(i, n) ford2(i, n, 0)

#define chmax(x, v) x = max(x, (v))
#define chmin(x, v) x = min(x, (v))
#define fi first
#define se second

const long long BIG = 1000000000000000000LL;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;

void solve();
signed main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	solve();
	return 0;
}

const int MOD = 179424697;

void solve()
{
	int n, k; cin >> n >> k;
	if (k == 0) {
		string s; cin >> s;
		if (s == "?") cout << "Yes\n";
		else cout << "No\n";
		return;
	}
	int cnt = 0;
	int curPow = 1;
	int curTot = 0;
	form(i, n+1) {
		string s; cin >> s;
		if (s == "?") ++cnt;
		else { int x = stoi(s); curTot += x*curPow; curTot %= MOD; }
		curPow *= k; curPow %= MOD;
	}
	curTot += MOD; curTot %= MOD;
	if (cnt == 0) {
		if (curTot == 0) cout << "Yes\n";
		else cout << "No\n";
		return;
	}
	if (cnt%2 == n%2) cout << "Yes\n";
	else cout << "No\n";
}


#include <bits/stdc++.h>
using namespace std;

#define int long long
#define form2(i, a, b) for (int i = (a); i < (b); ++i)
#define ford2(i, a, b) for (int i = (a-1); i >= (b); --i)
#define form(i, n) form2(i, 0, n)
#define ford(i, n) ford2(i, n, 0)

#define chmax(x, v) x = max(x, (v))
#define chmin(x, v) x = min(x, (v))
#define fi first
#define se second

const long long BIG = 1000000000000000000LL;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;

void solve();
signed main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	solve();
	return 0;
}

const int MOD = 179424697;

void solve()
{
	int n, k; cin >> n >> k;
	int cnt = 0;
	int curPow = 1;
	int curTot = 0;
	string orig;
	form(i, n+1) {
		string s; cin >> s;
		if (i == 0) orig = s;
		if (s == "?") ++cnt;
		else { int x = stoi(s); curTot += x*curPow; curTot %= MOD; }
		curPow *= k; curPow %= MOD;
	}
	if (k == 0) {
		string s = orig;
		if ((s == "?" && cnt%2 == 1) || s == "0") cout << "Yes\n";
		else cout << "No\n";
		return;
	}
	curTot += MOD; curTot %= MOD;
	if (cnt == 0) {
		if (curTot == 0) cout << "Yes\n";
		else cout << "No\n";
		return;
	}
	if (n%2 == 1) cout << "Yes\n";
	else cout << "No\n";
}


#include <bits/stdc++.h>
using namespace std;

#define int long long
#define form2(i, a, b) for (int i = (a); i < (b); ++i)
#define ford2(i, a, b) for (int i = (a-1); i >= (b); --i)
#define form(i, n) form2(i, 0, n)
#define ford(i, n) ford2(i, n, 0)

#define chmax(x, v) x = max(x, (v))
#define chmin(x, v) x = min(x, (v))
#define fi first
#define se second

const long long BIG = 1000000000000000000LL;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;

void solve();
signed main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	solve();
	return 0;
}

const int MOD = 179424697;

void solve()
{
	int n, k; cin >> n >> k;
	int cnt = 0;
	int curPow = 1;
	int curTot = 0;
	string orig;
	form(i, n+1) {
		string s; cin >> s;
		if (i == 0) orig = s;
		if (s == "?") ++cnt;
		else { int x = stoi(s); curTot += x*curPow; curTot %= MOD; }
		curPow *= k; curPow %= MOD;
	}
	if (k == 0) {
		string s = orig;
		if ((s == "?" && (n+1-cnt)%2 == 1) || s == "0") cout << "Yes\n";
		else cout << "No\n";
		return;
	}
	curTot += MOD; curTot %= MOD;
	if (cnt == 0) {
		if (curTot == 0) cout << "Yes\n";
		else cout << "No\n";
		return;
	}
	if (n%2 == 1) cout << "Yes\n";
	else cout << "No\n";
}


#include <bits/stdc++.h>
using namespace std;

#define int long long
#define form2(i, a, b) for (int i = (a); i < (b); ++i)
#define ford2(i, a, b) for (int i = (a-1); i >= (b); --i)
#define form(i, n) form2(i, 0, n)
#define ford(i, n) ford2(i, n, 0)

#define chmax(x, v) x = max(x, (v))
#define chmin(x, v) x = min(x, (v))
#define fi first
#define se second

const long long BIG = 1000000000000000000LL;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;

void solve();
signed main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	solve();
	return 0;
}

const int MOD = 179424697;

void solve()
{
	int n, k; cin >> n >> k;
	if (k == 0) {
		string s; cin >> s;
		if (s == "0") cout << "Yes\n";
		else cout << "No\n";
		return;
	}
	int cnt = 0;
	int curPow = 1;
	int curTot = 0;
	form(i, n+1) {
		string s; cin >> s;
		if (s == "?") ++cnt;
		else { int x = stoi(s); curTot += x*curPow; curTot %= MOD; }
		curPow *= k; curPow %= MOD;
	}
	curTot += MOD; curTot %= MOD;
	if (cnt == 0) {
		if (curTot == 0) cout << "Yes\n";
		else cout << "No\n";
		return;
	}
	if (n%2 == 1) cout << "Yes\n";
	else cout << "No\n";
}


#include <bits/stdc++.h>
using namespace std;

#define int long long
#define form2(i, a, b) for (int i = (a); i < (b); ++i)
#define ford2(i, a, b) for (int i = (a-1); i >= (b); --i)
#define form(i, n) form2(i, 0, n)
#define ford(i, n) ford2(i, n, 0)

#define chmax(x, v) x = max(x, (v))
#define chmin(x, v) x = min(x, (v))
#define fi first
#define se second

const long long BIG = 1000000000000000000LL;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;

void solve();
signed main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	solve();
	return 0;
}

const int MOD = 179424697;

void solve()
{
	int n, k; cin >> n >> k;
	if (k == 0) {
		string s; cin >> s;
		if (s == "?" || s == "0") cout << "Yes\n";
		else cout << "No\n";
		return;
	}
	int cnt = 0;
	int curPow = 1;
	int curTot = 0;
	form(i, n+1) {
		string s; cin >> s;
		if (s == "?") ++cnt;
		else { int x = stoi(s); curTot += x*curPow; curTot %= MOD; }
		curPow *= k; curPow %= MOD;
	}
	curTot += MOD; curTot %= MOD;
	if (cnt == 0) {
		if (curTot == 0) cout << "Yes\n";
		else cout << "No\n";
		return;
	}
	if (n%2 == 1) cout << "Yes\n";
	else cout << "No\n";
}


#include <bits/stdc++.h>
#define endl '\n'
#define forn(i, n) for(int i = 0; i < n; ++i)
#define rep(i, a, b) for(int i = a; i < b; ++i)
#define eb emplace_back
#define pb push_back
#define fi first
#define se second
using namespace std;

using ld = long double;
using ll = long long;
using vi = vector<int>;
using pii = pair<int, int>;

const int MX = 1e5 + 1;

const int CANT_MODS = 3;
ll mod[3] = {1000000007, 1000000009, 3};

ll a[MX + 2];
bool definido[MX + 2];

ll evalua(int n, ll k){
    ll res[CANT_MODS];
    ll pot[CANT_MODS];
    forn(i, CANT_MODS){
        res[i] = 0;
        pot[i] = 1;
    }

    forn(i, n + 1){
        forn(j, CANT_MODS){
            ll aux = a[i] * pot[j];
            aux %= mod[j];
            res[j] = (res[j] + aux) % mod[j];
            pot[j] = (pot[j] * k) % mod[j];
        }
    }
    forn(i, CANT_MODS){
        if(res[i] != res[0]) return 1;
    }
    return res[0];
}

int main(){
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

    int n;
    cin >> n;
    int k;
    cin >> k;

    string linea;
    getline(cin, linea); // basura
    int faltan = 0;
    int turno = 0;
    forn(i, n+1){
        getline(cin, linea);
        if(linea[0] != '?'){
            turno = 1 - turno;
            stringstream ss(linea);
            ss >> a[i];
            definido[i] = true;
        }else{
            faltan = (faltan + 1) % 2;
        }
    }

    bool gano = false;

    if(k == 0){
        if(a[0] == 0){
            gano = true;
        }else if(!definido[0] && turno == 1){
            gano = true;
        }
    }else if(faltan == 0){
        if(evalua(n, (ll)k) == 0) gano = true;
    }else{
        if(!faltan) turno = 1 - turno;
        if(turno == 1) gano = true;
    }

    if(gano) cout << "Yes" << endl;
    else cout << "No" << endl;

    return 0;
}


#include <bits/stdc++.h>
#define endl '\n'
#define forn(i, n) for(int i = 0; i < n; ++i)
#define rep(i, a, b) for(int i = a; i < b; ++i)
#define eb emplace_back
#define pb push_back
#define fi first
#define se second
using namespace std;

using ld = long double;
using ll = long long;
using vi = vector<int>;
using pii = pair<int, int>;

const int MX = 1e5 + 1;

const int CANT_MODS = 3;
ll mod[3] = {1000000007, 1000000009, 3};

ll a[MX + 2];
bool definido[MX + 2];

ll evalua(int n, ll k){
    ll res[CANT_MODS];
    ll pot[CANT_MODS];
    forn(i, CANT_MODS){
        res[i] = 0;
        pot[i] = 1;
    }

    forn(i, n + 1){
        forn(j, CANT_MODS){
            ll aux = a[i] * pot[j];
            if(aux < 0) aux += mod[j];
            aux %= mod[j];
            res[j] = (res[j] + aux) % mod[j];
            pot[j] = (pot[j] * k) % mod[j];
            if(pot[j] < 0) pot[j] += mod[j];
        }
    }
    forn(i, CANT_MODS){
        if(res[i] != res[0]) return 1;
    }
    return res[0];
}

int main(){
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

    int n;
    cin >> n;
    int k;
    cin >> k;

    string linea;
    getline(cin, linea); // basura
    int faltan = 0;
    int turno = 0;
    forn(i, n+1){
        getline(cin, linea);
        if(linea[0] != '?'){
            turno = 1 - turno;
            stringstream ss(linea);
            ss >> a[i];
            definido[i] = true;
        }else{
            faltan = (faltan + 1) % 2;
        }
    }

    bool gano = false;

    if(k == 0){
        if(a[0] == 0){
            gano = true;
        }else if(!definido[0] && turno == 1){
            gano = true;
        }
    }else if(faltan == 0){
        if(evalua(n, (ll)k) == 0) gano = true;
    }else{
        if(!faltan) turno = 1 - turno;
        if(turno == 1) gano = true;
    }

    if(gano) cout << "Yes" << endl;
    else cout << "No" << endl;

    return 0;
}


#include <bits/stdc++.h>
#define endl '\n'
#define forn(i, n) for(int i = 0; i < n; ++i)
#define rep(i, a, b) for(int i = a; i < b; ++i)
#define eb emplace_back
#define pb push_back
#define fi first
#define se second
using namespace std;

using ld = long double;
using ll = long long;
using vi = vector<int>;
using pii = pair<int, int>;

const int MX = 1e5 + 1;

const int CANT_MODS = 4;
ll mod[CANT_MODS] = {1000000007, 1000000009, 2147483647LL, 3};

ll a[MX + 2];
bool definido[MX + 2];

ll evalua(int n, ll k){
    ll res[CANT_MODS];
    ll pot[CANT_MODS];
    forn(i, CANT_MODS){
        res[i] = 0;
        pot[i] = 1;
    }

    forn(i, n + 1){
        forn(j, CANT_MODS){
            ll aux = a[i] * pot[j];
            if(aux < 0) aux += mod[j];
            aux %= mod[j];
            res[j] = (res[j] + aux) % mod[j];
            pot[j] = (pot[j] * k) % mod[j];
            if(pot[j] < 0) pot[j] += mod[j];
        }
    }
    forn(i, CANT_MODS){
        if(res[i] != res[0]) return 1;
    }
    return res[0];
}

int main(){
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

    int n;
    cin >> n;
    int k;
    cin >> k;

    string linea;
    getline(cin, linea); // basura
    int faltan = 0;
    int turno = 0;
    forn(i, n+1){
        getline(cin, linea);
        if(linea[0] != '?'){
            turno = 1 - turno;
            stringstream ss(linea);
            ss >> a[i];
            definido[i] = true;
        }else{
            faltan++;
        }
    }

    bool gano = false;

    if(k == 0){
        if(definido[0] && a[0] == 0){
            gano = true;
        }else if(!definido[0] && turno == 1){
            gano = true;
        }
    }else if(faltan == 0){
        if(evalua(n, (ll)k) == 0) gano = true;
    }else{
        faltan %= 2;
        if(!faltan) turno = 1 - turno;
        if(turno == 1) gano = true;
    }

    if(gano) cout << "Yes" << endl;
    else cout << "No" << endl;

    return 0;
}


#include<cstdio>
#include<cstring>
using namespace std;
int a[100010],und[100010];
char s[50],buf[500];
long long abs(long long x){
	if(x<0) return -x;
	return x;
}
int main(){
	int n,k;
	scanf("%d%d",&n,&k);
	int i,cnt=0;
	for(i=0;i<=n;i++){
		scanf("%s",&s);
		if(s[0]=='?'){
			und[i]=1;
			cnt++;
		}
		else{
			sprintf(buf,"%s",s);
			sscanf(buf,"%d",&a[i]);
		}
	}
	long long xxx=0;
	if(!k){
		if(und[0]){
			if(cnt&1) puts("Yes");
			else puts("No");
		}
		else{
			if(a[0]) puts("No");
			else puts("Yes");
		}
	}
	else{
 		if(cnt==0){
			for(i=n;i>=0;i--){
				xxx*=k;
				xxx+=a[i];
				if(abs(xxx)>99998244353){
					puts("No");
					return 0;
				}
			}
			if(xxx) puts("No");
			else puts("Yes");
			return 0;
		}
		if(n&1) puts("Yes");
		else puts("No");
	}
	return 0;
}


#include<cstdio>
#include<cstring>
using namespace std;
int a[100010],und[100010];
char s[50],buf[500];
long long abs(long long x){
	if(x<0) return -x;
	return x;
}
int main(){
	int n,k;
	scanf("%d%d",&n,&k);
	int i,cnt=0;
	for(i=0;i<=n;i++){
		scanf("%s",&s);
		if(s[0]=='?'){
			und[i]=1;
			cnt++;
		}
		else{
			sprintf(buf,"%s",s);
			sscanf(buf,"%d",&a[i]);
		}
	}
	long long xxx=0;
	if(!k){
		if(und[0]){
			if((n+1-cnt)&1) puts("Yes");
			else puts("No");
		}
		else{
			if(a[0]) puts("No");
			else puts("Yes");
		}
	}
	else{
 		if(cnt==0){
			for(i=n;i>=0;i--){
				xxx*=k;
				xxx+=a[i];
				if(abs(xxx)>99998244353){
					puts("No");
					return 0;
				}
			}
			if(xxx) puts("No");
			else puts("Yes");
			return 0;
		}
		if(n&1) puts("Yes");
		else puts("No");
	}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

signed main()
{
#ifdef files
	ifstream cin("input.txt");
	ofstream cout("output.txt");
#endif
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    long long n,k;
    cin >> n >> k;
    vector<long long> v(n+1);
    long long cou=0;
    for(long long i=0; i<=n; i++){
        string s;
        cin >> s;
        if(s=="?")v[i]=1000000000;
        else{
            cou++;
            stringstream ss;
            ss << s;
            ss >> v[i];
        }
    }
    if(cou==n+1){
        vector<long long> mods;
        for(int i=0; i<10; i++){
            mods.push_back(rand()*1ll*rand()%1000000000 + 1000000000);
        }
        vector<long long> res(10);
        for(int i=n; i>=0; i--){
            for(int j=0; j<res.size(); j++){
                res[j]=k*res[j]%mods[j]+v[i];
                res[j]%=mods[j];
            }
        }
        for(int i=0; i<res.size(); i++){
            if(res[i]!=0)return cout << "No", 0;
        }
        cout << "Yes";
    }
    else if(k==0){
        if(cou%2){
            if(v[0]==0 || v[0]==1000000000){
                cout << "Yes";
            }
            else{
                cout << "No";
            }
        }
        else{
            if(v[0]!=0){
                cout << "No";
            }
            else{
                cout << "Yes";
            }
        }
    }
    else{
        if(n%2)cout << "Yes";
        else cout << "No";
    }
}


// Problem : E. The Last Fight Between Human and AI
// Contest : Codeforces - Codeforces Round #354 (Div. 2)
// URL : https://codeforces.com/problemset/problem/676/E
// Memory Limit : 256 MB
// Time Limit : 1000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

/*
 A Submission by $%U%$
 at time: $%Y%$-$%M%$-$%D%$ $%h%$:$%m%$:$%s%$
*/
#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define rep(i,n) for(int64_t i=0;i < (int64_t)(n);i++)
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define FILE_IN "cseq.inp"
#define FILE_OUT "cseq.out"
#define ofile freopen(FILE_IN,"r",stdin);freopen(FILE_OUT,"w",stdout)
#define fio ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define nfio cin.tie(0);cout.tie(0)
#define max(x,y) (((x)>(y))?(x):(y))
#define min(x,y) (((x)<(y))?(x):(y))
#define ord(a,b,c) ((a>=b)and(b>=c))
#define MOD (ll(1000000007))
#define MAX 300001
#define mag 320
#define p1 first
#define p2 second.first
#define p3 second.second
#define fi first
#define se second
#define pow2(x) (ll(1)<<x)
#define pii pair<int,int>
#define piii pair<int,pii>
#define For(i,__,___) for(int i=__;i<=___;i++)
#define Rep(i,__,___) for(int i=__;i>=___;i--)
#define ordered_set tree<long long,null_type,less<long long>,rb_tree_tag,tree_order_statistics_node_update>
#define endl "\n"
#define bi BigInt
typedef long long ll;
//---------END-------//
ll n,m,k,c[501],pos[100001],t,t1,i,j,qm;
ll coeff[100001];
int main()
{
//  ofile;
    fio;
    cin>>n>>k;
    if (k==0)
    {
    	int isqm=0;
    	string s0; cin>>s0;
    	if (s0=="?")
    	{
    		qm++;
    		isqm=1;
    	}
    	for (i=1;i<=n;i++)
    	{

    	string s; cin>>s;
    	if (s=="?")
    	{
    		qm++;
    	}
    	}
    	if (isqm)
    	{
    		if ((n+1-qm)%2) cout<<"Yes"; else cout<<"No";
    	}
    	else
    	if (s0=="0") cout<<"Yes"; else cout<<"No";
    }
    else
    {
    	for (i=0;i<=n;i++)
    	{
    		string s;
    		cin>>s;
    		if (s=="?")
    		{
    			if ((n+1)%2) cout<<"No"; else cout<<"Yes";
    			return 0;
    		}
    		else
    		{
    			coeff[i]=stoi(s);
    		}
    	}
    	ll val=0;
    	for (i=n;i>=0;i--)
    	{
    		if (abs(val)>=1e9)
    		{
    			cout<<"No"; return 0;
    		}
  //  		cout<<coeff[i]<<' ';
    		val*=k;
    		val+=coeff[i];
    		if (abs(val)>=1e9)
    		{
    			cout<<"No"; return 0;
    		}
    	}
    	if (val) cout<<"No"; else cout<<"Yes";
    }
}


// Problem : E. The Last Fight Between Human and AI
// Contest : Codeforces - Codeforces Round #354 (Div. 2)
// URL : https://codeforces.com/problemset/problem/676/E
// Memory Limit : 256 MB
// Time Limit : 1000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

/*
 A Submission by $%U%$
 at time: $%Y%$-$%M%$-$%D%$ $%h%$:$%m%$:$%s%$
*/
#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define rep(i,n) for(int64_t i=0;i < (int64_t)(n);i++)
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define FILE_IN "cseq.inp"
#define FILE_OUT "cseq.out"
#define ofile freopen(FILE_IN,"r",stdin);freopen(FILE_OUT,"w",stdout)
#define fio ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define nfio cin.tie(0);cout.tie(0)
#define max(x,y) (((x)>(y))?(x):(y))
#define min(x,y) (((x)<(y))?(x):(y))
#define ord(a,b,c) ((a>=b)and(b>=c))
#define MOD (ll(1000000007))
#define MAX 300001
#define mag 320
#define p1 first
#define p2 second.first
#define p3 second.second
#define fi first
#define se second
#define pow2(x) (ll(1)<<x)
#define pii pair<int,int>
#define piii pair<int,pii>
#define For(i,__,___) for(int i=__;i<=___;i++)
#define Rep(i,__,___) for(int i=__;i>=___;i--)
#define ordered_set tree<long long,null_type,less<long long>,rb_tree_tag,tree_order_statistics_node_update>
#define endl "\n"
#define bi BigInt
typedef long long ll;
//---------END-------//
ll n,m,k,c[501],pos[100001],t,t1,i,j,qm;
ll coeff[100001];
int main()
{
//  ofile;
    fio;
    cin>>n>>k;
    if (k==0)
    {
    	for (i=1;i<=n;i++)
    	{
    		string s; cin>>s;
    		if (s=="?") qm++;
    	}
    		string s; cin>>s;
    		if (s=="?")
    		{
    			qm++;
    			if (((n+1)-qm)%2) cout<<"Yes"; else cout<<"No";
    		}
    }
    else
    {
    	for (i=0;i<=n;i++)
    	{
    		string s;
    		cin>>s;
    		if (s=="?")
    		{
    			if ((n+1)%2) cout<<"No"; else cout<<"Yes";
    			return 0;
    		}
    		else
    		{
    			coeff[i]=stoi(s);
    		}
    	}
    	ll val=0;
    	for (i=n;i>=0;i--)
    	{
    		if (abs(val)>=1e9)
    		{
    			cout<<"No"; return 0;
    		}
  //  		cout<<coeff[i]<<' ';
    		val*=k;
    		val+=coeff[i];
    		if (abs(val)>=1e9)
    		{
    			cout<<"No"; return 0;
    		}
    	}
    	if (val) cout<<"No"; else cout<<"Yes";
    }
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
#define fi first
#define se second
int n, k, res = 0, cnt = 0;
int string_to_int(string &s) {
    if(s == "?") return cnt++, 0;
    int ret = 0;
    for(int i = 0; i < int(s.size()); i++)
        ret = ret * 10 + s[i] - '0';
    return ret;
}

int main() {
#ifdef local
    freopen("in.txt", "r", stdin);
#endif
    ios::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);

    cin >> n >> k; vector<int> poly(n + 1);
    for(int i = 0; i <= n; i++) {
        string s; cin >> s;
        a[i] = string_to_int(s);
    }
    for(int i = n; ~i; i--)
        res = res * 10 + a[i];
    if(!cnt) cout << (res?"No":"Yes") << endl;
    else {
        if(~cnt&1) cout << "No" << endl;
        else cout << "Yes" << endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
#define fi first
#define se second
int n, k, res = 0, cnt = 0;
int string_to_int(string &s) {
    if(s[0] == '?') return INT_MIN;
    cnt++;
    int ret = 0, sign = 1;
    if(s[0] == '-') sign = -1;
    for(int i = s[0]=='-'; i < int(s.size()); i++)
        ret = ret * 10 + s[i] - '0';
    return sign*ret;
}

int main() {
#ifdef local
    freopen("in.txt", "r", stdin);
#endif
    ios::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);

    cin >> n >> k; vector<int> poly(n + 1);
    for(int i = 0; i <= n; i++) {
        string s; cin >> s;
        poly[i] = string_to_int(s);
    }
    if(!k) {
        if(poly[0] == INT_MIN) return cout << ((cnt&1)?"Yes":"No") << endl, 0;
        cout << (poly[0]?"No":"Yes") << endl;
    } else {
        for(int i = 0; i <= n; i++)
            if(poly[i] == INT_MIN) return cout << ((n&1)?"Yes":"No") << endl, 0;
        default_random_engine e(time(0));
        uniform_int_distribution<int> x(2, 1000000000);
        for(int i = 0; i < 10; i++) {
            int mod = x(e);
            ll temp = 0;
            for(int j = n; ~j; j--)
                temp = (temp * k + poly[j]) % mod;
            if(!temp) return cout << "No" << endl, 0;
        }
        cout << "Yes" << endl;
    }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
#define fi first
#define se second
int n, k, res = 0, cnt = 0;
int string_to_int(string &s) {
    if(s[0] == '?') return INT_MIN;
    cnt++;
    int ret = 0, sign = 1;
    if(s[0] == '-') sign = -1;
    for(int i = s[0]=='-'; i < int(s.size()); i++)
        ret = ret * 10 + s[i] - '0';
    return sign*ret;
}

int main() {
#ifdef local
    freopen("in.txt", "r", stdin);
#endif
    ios::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);

    cin >> n >> k; vector<int> poly(n + 1);
    for(int i = 0; i <= n; i++) {
        string s; cin >> s;
        poly[i] = string_to_int(s);
    }
    if(!k) {
        if(poly[0] == INT_MIN) return cout << ((cnt&1)?"Yes":"No") << endl, 0;
        cout << (poly[0]?"No":"Yes") << endl;
    } else {
        for(int i = 0; i <= n; i++)
            if(poly[i] == INT_MIN) return cout << ((n&1)?"Yes":"No") << endl, 0;
        default_random_engine e(time(0));
        uniform_int_distribution<int> x(2, 1000000000);
        for(int i = 0; i < 10; i++) {
            int mod = x(e);
            ll temp = 0;
            for(int j = n; ~j; j--)
                temp = (temp * k + poly[j]) % mod;
            if(temp) return cout << "No" << endl, 0;
        }
        cout << "Yes" << endl;
    }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
#define fi first
#define se second
int n, k, res = 0, cnt = 0;
int string_to_int(string &s) {
    if(s[0] == '?') return INT_MIN;
    cnt++;
    int ret = 0, sign = 1;
    if(s[0] == '-') sign = -1;
    for(int i = s[0]=='-'; i < int(s.size()); i++)
        ret = ret * 10 + s[i] - '0';
    return sign*ret;
}

int main() {
#ifdef local
    freopen("in.txt", "r", stdin);
#endif
    ios::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);

    cin >> n >> k; vector<int> poly(n + 1);
    for(int i = 0; i <= n; i++) {
        string s; cin >> s;
        poly[i] = string_to_int(s);
    }
    if(!k) {
        if(poly[0] == INT_MIN) return cout << ((cnt&1)?"Yes":"No") << endl, 0;
        cout << (poly[0]?"No":"Yes") << endl;
    } else {
        for(int i = 0; i <= n; i++)
            if(poly[i] == INT_MIN) return cout << ((n&1)?"Yes":"No") << endl, 0;
        unsigned long long res = 0;
        for(int i = n; ~i; i--)
            res = res * k + poly[i];
        if(!res) cout << "Yes" << endl;
        else cout << "No" << endl;
    }

    return 0;
}


#include <bits/stdc++.h>
#define int long long
#define ld long double
#define y1 eohfweoifhew
#define y0 wepfjwewpjfef

using namespace std;
const int MOD1 = 998244353;
const int MOD2 = 1e9 + 7;
const int MOD4 = 1e9 + rand();

int n, k;
string a[100005];

int f(string x)
{
    int ans = 0;

    for(auto to:x)
        if(to != '-')
    {
        ans = 10 * ans + to - '0';
    }

    if(x[0] == '-')
        ans = -ans;

    return ans;
}

int32_t main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    cin >> n >> k;

    for(int i = 0; i < n + 1; i++)
        cin >> a[i];

    int F = 0;

    for(int i = 0; i < n + 1; i++)
        if(a[i] == "?")
            F = 1;

    if(F == 0)
    {
        int x1 = 0;
        int x2 = 0;
        int x3 = 0;
        int x4 = 0;

        for(int i = n; i >= 0; i--)
        {
            x1 = (x1 * k + f(a[i])) % MOD1;
            x2 = (x2 * k + f(a[i])) % MOD2;
            x3 = x3 * k + f(a[i]);
            x4 = (x4 * k + f(a[i])) % MOD4;
        }

        if(x1 == 0 && x2 == 0 && x3 == 0 && x4 == 0)
            cout << "Yes";
        else cout << "No";
    }
    else
    {
        if(n % 2 == 0)
            cout << "No";
        else cout << "Yes";
    }
}


#include <bits/stdc++.h>
#define int long long
#define ld long double
#define y1 eohfweoifhew
#define y0 wepfjwewpjfef

using namespace std;
const int MOD1 = 998244353;
const int MOD2 = 1e9 + 7;
const int MOD4 = 1e9 + rand();
const int MOD5 = 1e6 + 3;
const int MOD6 = 9309706;

int n, k;
string a[100005];

int f(string x)
{
    int ans = 0;

    for(auto to:x)
        if(to != '-')
    {
        ans = 10 * ans + to - '0';
    }

    if(x[0] == '-')
        ans = -ans;

    return ans;
}

int32_t main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    cin >> n >> k;

    while(true)
    {
        string s;
        cin >> s;

        cout << f(s) << endl;
    }

    for(int i = 0; i < n + 1; i++)
        cin >> a[i];

    int F = 0;

    for(int i = 0; i < n + 1; i++)
        if(a[i] == "?")
            F = 1;

    if(F == 0)
    {
        int x1 = 0;
        int x2 = 0;
        int x3 = 0;
        int x4 = 0;
        int x5 = 0;
        int x6 = 0;

        for(int i = n; i >= 0; i--)
        {
            x1 = (x1 * k + f(a[i])) % MOD1;
            x2 = (x2 * k + f(a[i])) % MOD2;
            x3 = x3 * k + f(a[i]);
            x4 = (x4 * k + f(a[i])) % MOD4;
            x5 = (x5 * k + f(a[i])) % MOD5;
            x6 = (x6 * k + f(a[i])) % MOD6;
        }

        if(x1 == 0)
            cout << "Yes";
        else cout << "No";
    }
    else
    {
        if(n % 2 == 0)
            cout << "No";
        else cout << "Yes";
    }
}


#include <bits/stdc++.h>
#define int long long
#define ld long double
#define y1 eohfweoifhew
#define y0 wepfjwewpjfef

using namespace std;

int n, k;
string a[100005];

int f(string x)
{
    int ans = 0;

    for(auto to:x)
        if(to != '-')
    {
        ans = 10 * ans + to - '0';
    }

    if(x[0] == '-')
        ans = -ans;

    return ans;
}

int32_t main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    cin >> n >> k;

    for(int i = 0; i < n + 1; i++)
        cin >> a[i];

    int F = 0;

    for(int i = 0; i < n + 1; i++)
        if(a[i] == "?")
            F = 1;

    if(F == 0)
    {
        ld x = 0;
        ld Max = 0;

        for(int i = n; i >= 0; i--)
        {
            x = x * k + f(a[i]);
            if(abs(x) > 1e10)
            {
                cout << "No";
                return 0;
            }

            Max = max(Max, x);
        }

        if(abs(x / Max) < 1e-9)
            cout << "Yes";
        else cout << "No";
    }
    else
    {
        if(n % 2 == 0)
            cout << "No";
        else cout << "Yes";
    }
}


#include <bits/stdc++.h>
#define int long long
#define ld long double
#define y1 eohfweoifhew
#define y0 wepfjwewpjfef

using namespace std;
const int MOD1 = 998244353;
const int MOD2 = 1e9 + 7;
const int MOD4 = 1e9 + rand();
const int MOD5 = 1e6 + 3;
const int MOD6 = 9309706;

int n, k;
string a[100005];

int f(string x)
{
    int ans = 0;

    for(auto to:x)
        if(to != '-')
    {
        ans = 10 * ans + to - '0';
    }

    if(x[0] == '-')
        ans = -ans;

    return ans;
}

int32_t main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    cin >> n >> k;

    for(int i = 0; i < n + 1; i++)
        cin >> a[i];

    int F = 0;

    for(int i = 0; i < n + 1; i++)
        if(a[i] == "?")
            F = 1;

    if(F == 0)
    {
        int x1 = 0;
        int x2 = 0;
        int x3 = 0;
        int x4 = 0;
        int x5 = 0;
        int x6 = 0;

        for(int i = n; i >= 0; i--)
        {
            x1 = (x1 * k + f(a[i])) % MOD1;
            x2 = (x2 * k + f(a[i])) % MOD2;
            x3 = x3 * k + f(a[i]);
            x4 = (x4 * k + f(a[i])) % MOD4;
            x5 = (x5 * k + f(a[i])) % MOD5;
            x6 = (x6 * k + f(a[i])) % MOD6;
        }

        if(x1 == 0 && x2 == 0 && x3 == 0 && x4 == 0 && x5 == 0 && x6 == 0)
            cout << "Yes";
        else cout << "No";
    }
    else
    {
        if(n % 2 == 0)
            cout << "No";
        else cout << "Yes";
    }
}


#include <bits/stdc++.h>
#define int long long
#define ld long double
#define y1 eohfweoifhew
#define y0 wepfjwewpjfef

using namespace std;
const int MOD1 = 998244353;
const int MOD2 = 1e9 + 7;
const int MOD4 = 1e9 + rand();

int n, k;
string a[100005];

int f(string x)
{
    int ans = 0;

    for(auto to:x)
        if(to != '-')
    {
        ans = 10 * ans + to - '0';
    }

    if(x[0] == '-')
        ans = -ans;

    return ans;
}

int32_t main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    cin >> n >> k;

    for(int i = 0; i < n + 1; i++)
        cin >> a[i];

    if(k == 0)
    {
        if(a[0] == "0")
            cout << "Yes";
        else if(a[0] != "?")
            cout << "No";
        else
        {
            int k = 0;

            for(int i = 0; i <= n; i++)
                if(a[i] != "?")
                k++;

            if(k % 2)
                cout << "Yes";
            else cout << "No";
        }

        return 0;
    }

    int F = 0;

    for(int i = 0; i < n + 1; i++)
        if(a[i] == "?")
            F = 1;

    if(F == 0)
    {
        int x1 = 0;
        int x2 = 0;
        int x3 = 0;
        int x4 = 0;

        for(int i = n; i >= 0; i--)
        {
            x1 = (x1 * k + f(a[i])) % MOD1;
            x2 = (x2 * k + f(a[i])) % MOD2;
            x3 = x3 * k + f(a[i]);
            x4 = (x4 * k + f(a[i])) % MOD4;
        }

        if(x1 == 0 && x2 == 0 && x3 == 0 && x4 == 0)
            cout << "Yes";
        else cout << "No";
    }
    else
    {
        if(n % 2 == 0)
            cout << "No";
        else cout << "Yes";
    }
}


#include <bits/stdc++.h>
#define int long long
#define ld long double
#define y1 eohfweoifhew
#define y0 wepfjwewpjfef

using namespace std;

int n, k;
string a[100005];

int f(string x)
{
    int ans = 0;

    for(auto to:x)
        if(to != '-')
    {
        ans = 10 * ans + to - '0';
    }

    if(x[0] == '-')
        ans = -ans;

    return ans;
}

int32_t main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    cin >> n >> k;

    for(int i = 0; i < n + 1; i++)
        cin >> a[i];

    int F = 0;

    for(int i = 0; i < n + 1; i++)
        if(a[i] == "?")
            F = 1;

    if(F == 0)
    {
        ld x = 0;

        for(int i = n; i >= 0; i--)
        {
            x = x * k + f(a[i]);
            if(abs(x) > 1e10)
            {
                cout << "No";
                return 0;
            }
        }

        if(x == 0)
            cout << "Yes";
        else cout << "No";
    }
    else
    {
        if(n % 2 == 0)
            cout << "No";
        else cout << "Yes";
    }
}


#include <iostream>

using namespace std;

int main()
{   int N;
    int k;
    int diff=10000;
    int index_1;
    int index_2;
    int a[100];
    cin>>a[0];
    for (i=1;i<=N;i++)
    cin >>a[i];
    if (|a[i]-a[i-1]| <diff){
    diff =|a[i]-a[i-1]|;
    index_1 = i+1;
    index_2= i;
    }

    if (|a[0]-a[N-1]<diff)
    cout<<"1"<<" 2";
}


#include <iostream>

using namespace std;

int main()
{int n;
    cin >> n;
    int d=10000;
    int m,k;

    int a[n];
    for (int i=0;i<n;i++)
        cin>>a[i];
        for (int i=0;i<n;i++){
           for (int j=0;j<n;j++){
            if (i!=j && abs(a[i]-a[j])<d){
            m=i;
            k=j;
            d=abs(a[i]-a[j]);

           }
        }
        }
        if (abs(a[0]-a[n-1])<d)
            cout <<1<<" "<<n;

        else
        cout <<m+1<<" "<<k+1;

                return 0;
}


#include <iostream>

using namespace std;

int main()
{int n;
    cin >> n;
    int d=100000;
    int m,k;

    int a[n];
    for (int i=0;i<n;i++)
        cin>>a[i];

           for (int i=1;i<n;i++){
            if (abs(a[i]-a[i-1])<d){
            m=i;
            k=i-1;
            d=abs(a[i]-a[i-1]);

           }
        }

                if (abs(a[0]-a[n-1])<d)
            cout <<1<<" "<<n;

        else
        cout <<m+1<<" "<<k+1;

                return 0;
}


#include <iostream>

using namespace std;

int main()
{int n;
    cin >> n;
    int d=100000;
    int m,k;

    int a[n];
    for (int i=0;i<n;i++)
        cin>>a[i];
        for (int i=0;i<n-1;i++){
           for (int j=i+1;j<n;j++){
            if (abs(a[i]-a[j])<d){
            m=i;
            k=j;
            d=abs(a[i]-a[j]);

           }
        }
        }
        if (abs(a[0]-a[n-1])<d)
            cout <<1<<" "<<n;

        else
        cout <<m+1<<" "<<k+1;

                return 0;
}


#include <iostream>

using namespace std;

int main()
{   int N;
    int k;
    int diff=10000;
    int index_1;
    int index_2;
    int a[100];
    cin>>N;
    cin>>a[0];
    for (int i=1;i<=N;i++){
    cin >>a[i];
    if (abs(a[i]-a[i-1]) <diff){
    diff =abs(a[i]-a[i-1]);
    index_1 = i+1;
    index_2= i;
    }

}
    if (abs(a[0]-a[N-1])<diff)
    cout<<"1"<<" 2";
    else cout<<index_1<<" "<<index_2;
    return 0;
}


#include <iostream>

using namespace std;

int main()
{   int N;
    int k;
    int diff=10000;
    int index_1;
    int index_2;
    int a[100];
    cin>>N;
    cin>>a[0];
    for (int i=1;i<N;i++){
    cin >>a[i];
    if (abs(a[i]-a[i-1]) <diff){
    diff =abs(a[i]-a[i-1]);
    index_1 = i+1;
    index_2= i;
    }

}
    if (abs(a[0]-a[N-1])<diff)
    cout<<"1"<<" "<<N;
    else cout<<index_1<<" "<<index_2;
    return 0;
}


#include <iostream>

using namespace std;

int main()
{int n;
    cin >> n;
    int d=100000;
    int m,k;

    int a[n];
    for (int i=0;i<n;i++)
        cin>>a[i];
        for (int i=0;i<n;i++){
           for (int j=i+1;j<n-1;j++){
            if (abs(a[i]-a[j])<d){
            m=i;
            k=j;
            d=abs(a[i]-a[j]);

           }
        }
        }
        if (abs(a[0]-a[n-1])<d)
            cout <<1<<" "<<n;

        else
        cout <<m+1<<" "<<k+1;

                return 0;
}


#include <iostream>

using namespace std;

int main()
{int n;
    cin >> n;
    int d=1000;
    int m,k;

    int a[n];
    for (int i=0;i<n;i++)
        cin>>a[i];
        for (int i=0;i<n;i++){
           for (int j=0;j<n;j++){
            if (i!=j && abs(a[i]-a[j])<d){
            m=i;
            k=j;
            d=abs(a[i]-a[j]);

           }
        }
        }
        if (abs(a[0]-a[n-1])<d)
            cout <<1<<" "<<n;

        else
        cout <<m+1<<" "<<k+1;

                return 0;
}


#include<iostream>
#include<climits>
#include<vector>
#include<cmath>
using namespace std;
int main(){
    int n;
    cin>>n;
    vector<int>v;
    for(int i=0;i<n;i++){
        int x;
        cin>>x;
        v.push_back(x);
    }
    int min=INT_MAX;
    pair<int, int >m(0,0);
    for(int i=0;i<n-1;i++){
        for(int j=i+1;j<n;j++){
            int x=abs(v[i]-v[j]);
            if(x<min){
                min=x;
                m.first=i+1;
                m.second=j+1;
            }
        }
    }
    cout<<m.first<<" "<<m.second;
    return 0;
}


#include<iostream>
#include<climits>
#include<vector>
using namespace std;
int main(){
    int n;
    cin>>n;
    vector<int>v;
    for(int i=0;i<n;i++){
        int x;
        cin>>x;
        v.push_back(x);
    }
    int min=INT_MAX;
    pair<int, int >m(0,0);
    for(int i=0;i<n-1;i++){
        for(int j=i+1;j<n;j++){
            int x=v[i]-v[j];
            if(x<min&&x>=0){
                min=x;
                //cout<<min<<" ";
                m.first=i+1;
                m.second=j+1;
            }
        }
    }
    cout<<m.first<<" "<<m.second;
    return 0;
}


#include<iostream>
#include<climits>
#include<vector>
using namespace std;
int main(){
    int n;
    cin>>n;
    vector<int>v;
    for(int i=0;i<n;i++){
        int x;
        cin>>x;
        v.push_back(x);
    }
    int min=INT_MAX;
    int y;
    pair<int, int >m(0,0);
    for(int i=0;i<n-1;i++){
            y=abs(v[i]-v[i+1]);
            if(y<min&&y>=0){
                min=y;
                //cout<<min<<" ";
                m.first=i+1;
                m.second=i+2;
            }
        }
        y=abs(v[0]-v[n-1]);
        if(y<min){
            cout<<1<<" "<<n;
        }
        else
    cout<<m.first<<" "<<m.second;
    return 0;
    }


#include<iostream>
#include<climits>
#include<vector>
using namespace std;
int main(){
    int n;
    cin>>n;
    vector<int>v;
    for(int i=0;i<n;i++){
        int x;
        cin>>x;
        v.push_back(x);
    }
    int min=INT_MAX;
    pair<int, int >m(0,0);
    for(int i=0;i<n-1;i++){
            int x=abs(v[i]-v[i+1]);
            if(x<min&&x>=0){
                min=x;
                //cout<<min<<" ";
                m.first=i+1;
                m.second=i+2;
            }
        }
    cout<<m.first<<" "<<m.second;
    return 0;
    }


#include<iostream>
#include<climits>
#include<vector>
using namespace std;
int main(){
    int n;
    cin>>n;
    vector<int>v;
    for(int i=0;i<n;i++){
        int x;
        cin>>x;
        v.push_back(x);
    }
    int min=INT_MAX;
    int y;
    pair<int, int >m(0,0);
    for(int i=0;i<n-1;i++){
            y=abs(v[i]-v[i+1]);
            if(y<min&&y>=0){
                min=y;
                //cout<<min<<" ";
                m.first=i+1;
                m.second=i+2;
            }
        }
        y=abs(v[0]-v[n-1]);
        if(y<min){
            cout<<1<<" "<<n<<;
        }
        else
    cout<<m.first<<" "<<m.second;
    return 0;
    }


#include<iostream>
#include<climits>
#include<vector>
using namespace std;
int main(){
    int n;
    cin>>n;
    vector<int>v;
    for(int i=0;i<n;i++){
        int x;
        cin>>x;
        v.push_back(x);
    }
    int min=INT_MAX;
    int x;
    pair<int, int >m(0,0);
    for(int i=0;i<n-1;i++){
            x=abs(v[i]-v[i+1]);
            if(x<min&&x>=0){
                min=x;
                //cout<<min<<" ";
                m.first=i+1;
                m.second=i+2;
            }
        }
        x=abs(v[0]-v[n-1]);
        if(x<min){
            cout<<1<<" "<<n<<;
        }
        else
    cout<<m.first<<" "<<m.second;
    return 0;
    }


#include<iostream>
#include<climits>
#include<vector>
using namespace std;
int main(){
    int n;
    cin>>n;
    vector<int>v;
    for(int i=0;i<n;i++){
        int x;
        cin>>x;
        v.push_back(x);
    }
    int min=INT_MAX;
    pair<int, int >m(0,0);
    for(int i=0;i<n-1;i++){
            int x=abs(v[i]-v[i+1]);
            if(x<min&&x>=0){
                min=x;
                //cout<<min<<" ";
                m.first=i+1;
                m.second=i+2;
            }
        }
        x=abs(v[0]-v[n-1]);
        if(x<min){
            cout<<1<<" "<<n<<;
        }
        else
    cout<<m.first<<" "<<m.second;
    return 0;
    }


#include<iostream>
#include<climits>
#include<vector>
using namespace std;
int main(){
    int n;
    cin>>n;
    vector<int>v;
    for(int i=0;i<n;i++){
        int x;
        cin>>x;
        v.push_back(x);
    }
    int min=INT_MAX;
    pair<int, int >m(0,0);
    for(int i=0;i<n-1;i++){
            int x=abs(v[i]-v[i+1]);
            if(x<min&&x>=0){
                min=x;
                //cout<<min<<" ";
                m.first=i+1;
                m.second=i+2;
            }
        }
        x=abs(v[0]-v[n-1]);
        if(x<min){
            cout<<1<<" "<<n;
        }
        else
    cout<<m.first<<" "<<m.second;
    return 0;
    }


#include <bits/stdc++.h>
using namespace std;

int main() {
	int n,a[1000];
	cin>>n;
	for(int i=1;i<=n;i++)
	{
	    cin>>a[i];
	}
	int x=abs(a[1]-a[n]);
	for(int i=2;i<=n;i++)
	{
	    if(abs(a[i]-a[i-1])<x)
	    {
	        int s=i;
	        int l=i-1;
	    }
	}
	cout<<s<<" "<<l;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main() {
	int n,s,l;
	cin>>n;
	int a[n+1];
	for(int i=1;i<=n;i++)
	{
	    cin>>a[i];
	}
	int x=abs(a[1]-a[n]);
	for(int i=2;i<=n;i++)
	{
	    if(abs(a[i]-a[i-1])<x)
	    {
	         s=i;
	         l=i-1;
	    }
	}
	cout<<s<<" "<<l;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main() {
	int n;
	cin>>n;
	for(int i=1;i<=n;i++)
	{
	    cin>>a[i];
	}
	x=abs(a[1]-a[n]);
	for(int i=2;i<=n;i++)
	{
	    if(abs(a[i]-a[i-1])<x)
	    {
	        int s=i;
	        int l=i-1;
	    }
	}
	cout<<s<<" "<<l;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main() {
	int n,s,l;
	cin>>n;
	int a[n+1];
	for(int i=1;i<=n;i++)
	{
	    cin>>a[i];
	}
	int x=abs(a[1]-a[n]);
	l=n;
	s=1;
	for(int i=2;i<=n;i++)
	{
	    if(abs(a[i]-a[i-1])<x)
	    {
	         s=i;
	         l=i-1;
	    }
	}
	cout<<l<<" "<<s;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main() {
	int n,s,l;
	cin>>n;
	int a[n+1];
	for(int i=1;i<=n;i++)
	{
	    cin>>a[i];
	}
	int x=abs(a[1]-a[n]);
	l=n;
	s=1;
	for(int i=2;i<=n;i++)
	{
	    if(abs(a[i]-a[i-1])<x)
	    {
	         s=i;
	         l=i-1;
	    }
	}
	cout<<s<<" "<<l;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main() {
	int n,s,l;
	cin>>n;
	int a[n+1];
	for(int i=1;i<=n;i++)
	{
	    cin>>a[i];
	}
	int x=abs(a[1]-a[n]);
	l=n;
	s=1;
	for(int i=2;i<=n;i++)
	{
	    if(abs(a[i]-a[i-1])<x)
	    {
	        x=abs(a[i]-a[i-1]);
	         s=i;
	         l=i-1;
	    }
	}
	cout<<l<<" "<<s;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,i,d,k=1000,v,l;
    cin>>n;
    int a[n];
    for(i=0;i<n;i++)
    {
        cin>>a[i];
    }
    for(i=0;i<n;i++)
    {
        for(int j=i+1;j<n;j++)
        {
            d = a[j]>a[i]?(a[j]-a[i]):(a[i]-a[j]);
            if(d<=k)
            {
                k=d;
                v=i;
                l=j;
            }
        }
    }
    cout<<i<<" "<<j;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,i,d,k=1000,v,l,j;
    cin>>n;
    int a[n];
    for(i=0;i<n;i++)
    {
        cin>>a[i];
    }
    for(i=0;i<n;i++)
    {
        for(j=i+1;j<n;j++)
        {
            d = a[j]>a[i]?(a[j]-a[i]):(a[i]-a[j]);
            if(d<=k)
            {
                k=d;
                v=i+1;
                l=j+1;
            }
        }
    }
    cout<<v<<" "<<l;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,i,d,k=1000,v,l,j;
    cin>>n;
    int a[n];
    for(i=0;i<n;i++)
    {
        cin>>a[i];
    }
    for(i=0;i<n;i++)
    {
            d = a[i]>a[i+1]?(a[i]-a[i+1]):(a[i+1]-a[i]);
            if(d<=k)
            {
                k=d;
                v=i+1;
                l=i;
            }
    }
    cout<<v<<" "<<l;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,i,d,k=1000,v,l,j;
    cin>>n;
    int a[n];
    for(i=0;i<n;i++)
    {
        cin>>a[i];
    }
    for(i=0;i<n;i++)
    {
        for(j=i+1;j<n;j++)
        {
            d = a[j]>a[i]?(a[j]-a[i]):(a[i]-a[j]);
            if(d<=k)
            {
                k=d;
                v=i;
                l=j;
            }
        }
    }
    cout<<i<<" "<<j;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main ()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    int n,_min=0,pos1=0,pos2=0;
    cin>>n;
    int a[n];
    for(int i=0; i<n; ++i)
        cin>>a[i];

    _min=abs(a[n-1]-a[0]);
    pos1=1;
    pos2=n;
    for(int i=0; i<n-1; ++i)
    {
        if(abs(a[i]-a[i+1])<_min)
        {
            _min=abs(a[i]-a[i+1]);
            pos1=i+1;
            pos2=pos1+1;
        }
    }
    cout<<pos1<<" "<<pos2<<"\n";
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main ()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    int n,_min=0,pos1=0,pos2=0;
    cin>>n;
    int a[n];
    for(int i=0; i<n; ++i)
        cin>>a[i];

    _min=abs(a[n-1]-a[0]);
    pos1=1;
    pos2=n;
    for(int i=0; i<n; ++i)
    {
        if(abs(a[i]-a[i+1])<_min)
        {
            _min=abs(a[i]-a[i+1]);
            pos1=i+1;
            pos2=pos1+1;
        }
    }
    cout<<pos1<<" "<<pos2<<"\n";
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main ()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    int n,_min=1000,num1,num2,j;
    cin>>n;
    int a[n],b[n];
    for(int i=0; i<n; ++i)
    {
        cin>>a[i];
    }
    for(int i=0; i<n; ++i)
    {
        b[i]=a[i];
    }

    sort(a,a+n);
    for(int i=0; i<n-1; ++i)
    {
        if(abs(a[i]-a[i+1])<_min)
        {
            _min=abs(a[i]-a[i+1]);
            num1=a[i];
            num2=a[i+1];
        }
    }
    for(int i=0; i<n; ++i)
    {
        if(num1==b[i])
        {
            j=i;
            cout<<i+1<<" ";
            break;
        }
    }
    for(int i=0; i<n; ++i)
    {
        if(i==j)
            continue;
        if(num2==b[i])
        {
            cout<<i+1<<"\n";
            break;
        }
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main ()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    int n,_min=1000,num1,num2,j;
    cin>>n;
    int a[n],b[n];
    for(int i=0; i<n; ++i)
    {
        cin>>a[i];
    }
    for(int i=0; i<n; ++i)
    {
        b[i]=a[i];
    }

    sort(a,a+n);
    for(int i=0; i<n; ++i)
    {
        if(abs(a[i]-a[i+1])<_min)
        {
            _min=abs(a[i]-a[i+1]);
            num1=a[i];
            num2=a[i+1];
        }
    }
    for(int i=0; i<n; ++i)
    {
        if(num1==b[i])
        {
            j=i;
            cout<<i+1<<" ";
            break;
        }
    }
    for(int i=0; i<n; ++i)
    {
        if(i==j)
            continue;
        if(num2==b[i])
        {
            cout<<i+1<<"\n";
            break;
        }
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main ()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    int n,_min=0,pos1=0,pos2=0;
    cin>>n;
    int a[n+1];
    for(int i=0; i<n; ++i)
        cin>>a[i];

    _min=abs(a[n-1]-a[0]);
    pos1=1;
    pos2=n;
    for(int i=0; i<n; ++i)
    {
        if(abs(a[i]-a[i+1])<_min)
        {
            _min=abs(a[i]-a[i+1]);
            pos1=i+1;
            pos2=pos1+1;
        }
    }
    cout<<pos1<<" "<<pos2<<"\n";
    return 0;
}


#include<iostream>
using namespace std;
void add(int p[],int x,int y){
    for(int i=0;i<x;i++){
        if(p[i]==0){
            p[i]=y;
            break;
        }
    }
}
int main(){
    int n;
    cin>>n;
    int a[n];
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    int k=((n-1)*(n))/2;
    int b[k]={0};
    for(int i=0;i<n;i++){
        for(int j=i+1;j<n;j++){
            int z=(((a[i]-a[j])>=0)?(a[i]-a[j]):(a[j]-a[i]));
            add(b,k,z);
        }
    }
    int min=b[0];
    for(int i=0;i<k;i++){
        if(b[i]<min){
            min=b[i];
        }
    }

    int s;
    int r;
        for(int i=0;i<n;i++){
            for(int j=i+1;j<n;j++){
                if(((a[i]-a[j])==min)||((a[j]-a[i])==min)){
                    if(i==0&&j==n-1){
                        s=j+1;
                        r=i+1;

                    }
                    else{
                        s=i+1;
                        r=j+1;
                                            }

                }

            }
        }
        cout<<s<<r;
   return 0;

}


#include<bits/stdc++.h>
using namespace std;
int ans=10001,l,r,i,j,k,n,m;
int main()
{
    cin>>n;
    for(int i=1;i<=n;i++)
	{
        cin>>k;
        if(i==1)m=k;
        else if(ans>abs(k-j))
		{
            l=i-1;
            r=i;
            ans=abs(k-j);
        }
        j=k;
    }
    if(ans>abs(k-m))l=n,r=1;
    cout<<l<<" "<<r<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int MAXN=105;
int ans=1000000,h[MAXN];
int main(){
    int n;
    scanf ("%d",&n);
    for (int i=1;i<=n;i++)
        scanf ("%d",h+i);
    for (int i=1;i<n;i++)
        ans=min(ans,abs(h[i]-h[i+1]));
    ans=min(ans,abs(h[n]-h[1]));
    printf ("%d",ans);
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int a[101],t,min1=10000;
int main()
{
	int n;
	scanf("%d",&n);
	for (int i=1;i<=n;i++)
	  scanf("%d",&a[i]);
	a[++n]=a[1];
	for (int i=1;i<=n;i++)
	  if (abs(a[i]-a[i+1])<min1)
	  {
	  	min1=abs(a[i]-a[i+1]);
	  	t=i;
	  }
	if (t==n-1) printf("%d 1",t);
	else printf("%d %d",t,t+1);
	return 0;
}


#include<cstdio>
#include<algorithm>
#include<cmath>
using namespace std;
int n;
int a[1005000];
int ans=0x7fffffff;
int x,y;
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
	{
		scanf("%d",&a[i]);
		if(i>=2)
		{
			if(ans>abs(a[i]-a[i-1]))
			{
				ans=abs(a[i]-a[i-1]);
				x=i-1;
				y=i;
			}
		}
	}
	if(ans>abs(a[n]-a[1]))
	{
		x=1;
		y=n;
	}
	printf("%d %d",x,y);
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int MAXN=105;
int ans=1000000,h[MAXN],x,y;
int main(){
    int n;
    scanf ("%d",&n);
    for (int i=1;i<=n;i++)
        scanf ("%d",h+i);
    for (int i=1;i<n;i++)
        if (ans>abs(h[i]-h[i+1])){
            x=i,y=i+1;
            ans=abs(h[i]-h[i+1]);
        }
    if (ans>abs(h[n]-h[1])){
        x=n,y=1;
    }
    printf ("%d %d",x,y);
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int n,h[200],x,y;
int main()
{
	scanf("%d",&n);
	for(int i=1; i<=n; i++)
	 scanf("%d",h+i);
	int ans;
	ans = abs( h[1]-h[n] );
	x = 1,y = n;
	for(int i=1; i<n; i++)
	 {
	 	if( abs( h[i]-h[i+1] ) < ans )
	 	 {
	 	 	 ans = abs(h[i]-h[i+1]);
	 	 	 x = i;
	 	 	 y = i+1;
	 	 }
	 }
	printf("%d %d\n",x,y);
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int a[110];
int main()
{
    long long i,j,k,n,m,t=0,l,r,t1=0,x,y;
    cin>>n;
    for(i=1;i<=n;i++)
    {
    	cin>>a[i];
	}
	x=n;
	y=1;
	t=abs(a[n]-a[1]);
	for(i=1;i<=n-1;i++)
	{
		if(abs(a[i]-a[i+1])<t)
		{
			t=abs(a[i]-a[i+1]);
			x=i+1;
			y=i;
		}
	}
	cout<<x<<" "<<y;
    return 0;
}


#include <iostream>
#include <climits>
#include <cmath>
using namespace std;
int a[110];
int main()
{
	int n;
	cin >> n;
	for(int i = 1; i <= n; i++) {
		cin >> a[i];
	}
	for(int i = n - 1; i >= 2; i--) {
		a[i] = abs(a[i] - a[i - 1]);
	}
	a[1] = abs(a[1] - a[n]);
	a[n] = abs(a[n] - a[n - 1]);
	int ansx = a[1], x = n, y = 1;
	for(int i = 2; i <= n; i++) {
		if(a[i] < ansx) {
			ansx = a[i];
			x = i - 1;
			y = i;
		}
	}
	cout << x << " " << y;
	return 0;
}


#include <cstdio>
int n;
int h[105],ans=-1,x;

int min(int a,int b){return a<b?a:b;}
int abs(int a,int b){return a>=b?a-b:b-a;}
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
		scanf("%d",&h[i]);
	for(int i=2;i<=n;i++)
	{
		if(i!=n)
			x=abs(h[i]-h[i-1]);
		else
			x=abs(h[i]-h[1]);
		ans=min(ans,x);
	}
	printf("%d\n",ans);
	return 0;
}


//#include<bits/stdc++.h>
#include<iostream>
#include<iomanip>
#include<cstring>
#include<stack>
#include<vector>
//#include<conio.h>
#include<string>
#include<map>
#include<cstdlib>
#include<queue>
#include<math.h>
#include<time.h>
#include<set>
#include<cstdio>
#include<stdio.h>
#include<algorithm>
using namespace std;
using std::cin;
using std::cout;
using std::endl;
namespace IN{
    const int MAX_INPUT = 1000000;
    #define getc() (p1==p2&&(p2=(p1=buf)+inbuf->sgetn(buf,MAX_INPUT),p1==p2)?EOF:*p1++)
    char buf[MAX_INPUT],*p1,*p2;
    template<typename T>inline bool read(T &x) {
        static std::streambuf *inbuf=cin.rdbuf();
        x=0;
        register int f=0,flag=false;
        register char ch=getc();
        while(!isdigit(ch)){
            if (ch=='-') f=1;
        	ch=getc();
        }
        if(isdigit(ch)) x=x*10+ch-'0',ch=getc(),flag=true;
        while(isdigit(ch)) {
            x=x*10+ch-48;
            ch=getc();
        }
        x=f?-x:x;
        return flag;
    }
    template<typename T,typename ...Args>inline bool read(T& a,Args& ...args) {
       return read(a)&&read(args...);
    }
    #undef getc
}

namespace OUT{
    template<typename T>inline void put(T x){
        static std::streambuf *outbuf=cout.rdbuf();
        static char stack[21];
        static int top=0;
        if(x<0){
            outbuf->sputc('-');
            x=-x;
        }
        if(!x){
            outbuf->sputc('0');
            outbuf->sputc('\n');
            return;
        }
        while(x){
            stack[++top]=x%10+'0';
            x/=10;
        }
        while(top){
            outbuf->sputc(stack[top]);
            --top;
        }
        outbuf->sputc('\n');
    }
    inline void putc(const char ch){
        static std::streambuf *outbuf=cout.rdbuf();
        outbuf->sputc(ch);
    }
    inline void putstr(string s){
    	for(register int i=0;i<s.length();i++) putc(s[i]);
	}
    template<typename T>inline void put(const char ch,T x){
        static std::streambuf *outbuf=cout.rdbuf();
        static char stack[21];
        static int top = 0;
        if(x<0){
            outbuf->sputc('-');
            x=-x;
        }
        if(!x){
            outbuf->sputc('0');
            outbuf->sputc(ch);
            return;
        }
        while(x){
            stack[++top]=x%10+'0';
            x/=10;
        }
        while(top){
            outbuf->sputc(stack[top]);
            --top;
        }
        outbuf->sputc(ch);
    }
    template<typename T,typename ...Args> inline void put(T a,Args ...args){
        put(a);put(args...);
    }
    template<typename T,typename ...Args> inline void put(const char ch,T a,Args ...args){
        put(ch,a);put(ch,args...);
    }
}
using IN::read;
using OUT::put;
using OUT::putc;
using OUT::putstr;
int minn=1005,n,p[1005],l;
int main(int argc, char const *argv[]){
    std::ios::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    read(n);
    for(int i=1;i<=n;i++) read(p[i]);
    #define abs(x) (x>0?x:-x)
    for(int i=1;i<=n;i++)
    	if(abs(p[i]-p[(i+1)%n])<minn)
    		minn=abs(p[i]-p[(i+1)%n]),l=i;
    put(' ',l,(l+1)%n);
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int n, a[103];
int ans = 999999;

int main(){
	cin >> n;
	for(int i = 1; i <= n; i++){
		cin >> a[i];
	}
	a[n + 1] = a[n];
	for(int i = 1; i <= n; i++){
		ans = min(ans, abs(a[i] - a[i + 1]));
	}
	cout << ans;
	return 0;
}


#include <iostream>//输入输出流库
#include <cmath>//求绝对值的abs()所需的库
using namespace std;
int main(){
    int a[101]/*之前不小心开成100竟然没爆，可见这题数据良心，绝非毒瘤，可大胆尝试*/,n,minn=1001/*记录当前最小值*/,minx,miny;
    cin>>n;
    for(int i=1;i<=n;i++) cin>>a[i];
    for(int i=0;i<n;i++)
        if(minn>abs(a[i%n+1]-a[(i+1)%n+1])/*这样处理可以避免0的出现*/)
        {
            minn=abs(a[i%n+1]-a[(i+1)%n+1]);
            minx=i%n+1;
            miny=(i+1)%n+1;//三个赋值
        }
    cout<<minx<<" "<<miny<<endl;;//接着输出
    return 0;
}


#include <iostream>
#include <cmath>
using namespace std;
int main(){
    int a[101]
    cin>>n;
    for(int i=1;i<=n;i++) cin>>a[i];
    for(int i=0;i<n;i++)
        if(minn>abs(a[i%n+1]-a[(i+1)%n+1]))
        {
            minn=abs(a[i%n+1]-a[(i+1)%n+1]);
            minx=i%n+1;
            miny=(i+1)%n+1;
        }
    cout<<minx<<" "<<miny<<endl;
    return 0;
}


#include <cstdio>
#include <algorithm>
#include <cmath>
using namespace std;
int main()
{
	int n,ans = 0,num1,num2;
	scanf("%d",&n);
	int a[10011];
	for(int i = 1;i <= n;i++)
	{
		scanf("%d",&a[i]);
	}
	ans = abs(a[1] - a[n]);
	num1 = n;
	num2 = 1;
	for(int i = 1;i < n;i++)
	{
		if(ans > abs(a[i + 1] - a[i]))
		{
			ans = abs(a[i + 1] - a[i]);
			num1 = i;
			num2 = i + 1;
		}
	}
	printf("%d %d",num1,num2);
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,m=10000,x,y,a,b,x0;
    cin>>n>>x;
    x0=x;
    for(int i=1;i<n;i++)
    {
        cin>>y;
        if(abs(x-y)<m)
        {
            m=abs(x-y);
            a=i;
            b=i+1;
        }
        x=y;
    }
    if(abs(x-x0)<m)
    {
        cout<<n<<" "<<1;
        return 0;
    }
    cout<<a<<" "<<b;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int n, a[103];
int ans = 999999;

int main(){
	cin >> n;
	for(int i = 1; i <= n; i++){
		cin >> a[i];
	}
	a[n + 1] = a[1];
	for(int i = 1; i <= n; i++){
		ans = min(ans, abs(a[i] - a[i + 1]));
	}
	cout << ans;
	return 0;
}


#include <iostream>
#include <cstring>
#include <string>
#include <algorithm>
#include <cmath>
#include <queue>
#include <map>
#include <set>
#include <vector>
#define N 11000
using namespace std;
int n,a[N],x,y,minx = 99999999;
int main()
{
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
    cin >> n;
    for(int i=1; i<=n; i++)
    	cin >> a[i];
    minx = abs(a[1] - a[n]), x = n, y = 1;
    for(int i=2; i<=n; i++)
    {
    	if(minx > abs(a[i] - a[i - 1]))
    	{
    		minx = abs(a[i] - a[i - 1]);
    		x = i - 1, y = i;
		}
	}
	cout << x << " " << y << endl;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
	int n,h[102],ans=9999,x,y;
	cin>>n;
	for(int i=1;i<=n;i++)
		cin>>h[i];
	for(int i=1;i<=n;i++){
		h[n+1]=h[1];
		if(ans>=abs(h[i]-h[i+1])){
			ans=abs(h[i]-h[i+1]);
			x=i,y=i+1;
		}
	}
	cout<<x<<" "<<y<<endl;
	return 0;
}


#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<iostream>
#include<algorithm>
using namespace std;
int n;
int x,y;
int minn=32767;
int main()
{
	cin>>n;
	int head,ended;
	int dd;
	cin>>head;
	dd=head;
	for (int i=2;i<=n-1;++i)
	{
		int s;
		cin>>s;
		if (s>=dd)
		{
			if (minn>(s-dd))
			{
				x=i-1;
				y=i;
				minn=s-dd;
			}
		}
		else
		{
			if (minn>(dd-s))
			{
				x=i-1;
				y=i;
				minn=dd-s;
			}
		}
	}
	cin>>ended;
	if (head>=ended)
	{
		if (minn>=(head-ended))
		{
			x=1;
			y=n;
		}
	}
	else
	{
		if (minn>=(ended-head))
		{
			x=1;
			y=n;
		}
	}
	cout<<x<<" "<<y<<"\n";
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a[101],n,i,min1,x,y;
	cin>>n;
	for(i=1;i<=n;i++) cin>>a[i];
	min1=abs(a[1]-a[n]);
	x=n;
	y=1;
	for(i=1;i<=n-1;i++)
	if(abs(a[i]-a[i+1])<min1)
	{
	min1=abs(a[i]-a[i+1]);
	x=i;
	y=i+1;
	}
	cout<<x<<" "<<y;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int n,a[101],b[101],minn=1001,m;
int main(){
	scanf("%d",&n);
	for(int i=1;i<=n;++i)
		scanf("%d",&a[i]);
	for(int i=1;i<n;++i)
		b[i]=abs(a[i+1]-a[i]);
	b[n]=abs(a[n]-a[1]);
	for(int i=1;i<=n;++i)
		if(b[i]<minn){
			minn=b[i];
			m=i;
		}
	if(m==n){
		cout<<n<<" "<<1<<endl;
		return 0;
	}
	cout<<m<<" "<<m+1<<endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a[101];
	int l,r;
	int ans=100000000;
	int n;
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		cin>>a[i];
	}
	for(int i=1;i<=n;i++)
	{
		if(i!=1)
		{
			int pq=abs(a[i]-a[i-1]);
			if(ans>pq)
			{
				ans=pq;
				l=i-1;r=i;
			}
		}
		else
		{
			int pq=abs(a[n]-a[1]);
			if(ans>pq)
			{
				ans=pq;
				l=n;r=1;
			}
		}
	}
	cout<<l<<" "<<r<<endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int a[110];
int main()
{
	int n;
	scanf("%d",&n);
	for(int i=1;i<=n;i++)scanf("%d",&a[i]);
	int minn=abs(a[1]-a[n]),x=n,y=1;
	for(int i=1;i<n;i++)if(minn>abs(a[i]-a[i+1]))minn=abs(a[i]-a[i+1]),x=i,y=i+1;
	printf("%d %d",x,y);
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int n,k,x,ans=9999,d1=0,d2=0,temp;
int main(){
    cin>>n>>k;
    temp=k;
    for(int i=2;i<=n;i++){
        cin>>x;
        if(abs(x-k)<ans) {ans=abs(x-k);d1=i-1;d2=i;}
        k=x;
    }
    if(abs(k-temp)<ans) {d1=n;d2=1;}
    cout<<d1<<" "<<d2<<endl;
    return 0;
}


#include <iostream>
int m[1005];
int abs(int a,int b) {
	if (a - b >= 0) return a - b;
	return b - a;
}
int main() {
	int n;
	std::cin >> n;
	int minn = 1005,mpx,mpy;
	std::cin >> m[1];
	for (int i = 2; i <= n; i++) {
		std::cin >> m[i];
		if (abs(m[i] - m[i - 1]) < minn) {
			minn = abs(m[i] - m[i - 1]);
			mpx = i - 1;
			mpy = i;
		}
	}
	if (abs(m[1] - m[n]) < minn) {
		minn = abs(m[1] - m[n]);
		mpx = n;
		mpy = 1;
	}
	std::cout << mpx << ' ' << mpy;
	return 0;
}


#include <bits/stdc++.h>
#define N 110
using namespace std;
int n,h[N],ans,l,r;
int main()
{
	cin>>n;
	for(int i=1;i<=n;++i)
		cin>>h[i];
	ans=abs(h[1]-h[n]);
	l=1;
	r=n;
	for(int i=1;i<n;++i){
		int tem=abs(h[i]-h[i+1]);
		if(ans>tem){
			ans=tem;
			l=i;
			r=i+1;
		}
	}
	cout<<l<<" "<<r<<endl;
	return 0;
}


#include<cstdio>
#include<cmath>
using namespace std;
int a[110],n,m;
int main()
{
  scanf("%d",&n);
  for(int i=1;i<=n;i++)  scanf("%d",&a[i]);
  m=abs(a[1]-a[n]),x=n,y=1;
  for(int i=1;i<n;i++)
    if(m>abs(a[i]-a[i+1]))
      m=abs(a[i]-a[i+1]),x=i,y=i+1;
  printf("%d %d",x,y);
  return 0;
}


#include <iostream>
#include <cmath>
using namespace std;
int main() {
	int a[101], n, min, x, y;
	cin >> n;
	for(int i = 1; i <= n; i++)
	cin >> a[i];
	min = abs(a[1] - a[n]);
	x = 1;
	y = n;
	for(int i = 1; i < n; i++) {
		if(abs(a[i] - a[i + 1]) < min) {
			min = abs(a[i] - a[i + 1]);
			x = i;
			y = i + 1;
		}
	}
	cout << x << " " << y << endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int a[201]={0},n,mn,mx,my;
int main()
{
    cin>>n;
    for(int i=1;i<=n;i++)cin>>a[i];
    for(int i=0;i<n;i++)if(mn>abs(a[i%n+1]-a[(i+1)%n+1]))
    {
        mn=abs(a[i%n+1]-a[(i+1)%n+1]);
        mx=i%n+1;
        my=(i+1)%n+1;
    }
    cout<<mx<<' '<<my<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int n,Min=1005,minx,miny,h[105];//n和h如题。Min用于存最小的差：一个人身高最多1000，那身高差就不会超过1000.
int main(){
	scanf("%d",&n);
	for(int i=1;i<=n;i++){
		scanf("%d",&h[i]);
		if(i!=1){
			if(abs(h[i]-h[i-1])<Min){
				Min=abs(h[i]-h[i-1]);
				minx=i-1;
				miny=i;
			}
		}
	}
	if(abs(h[n]-h[1])<Min){
		Min=abs(h[n]-h[1]);
		minx=1;
		miny=n;
	}
	printf("%d %d",minx,miny);
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{

    int n, s1, s2;

    cin >> n;

    int s[n+2];

    for (int i = 1; i <= n; ++i)
    {
    	cin >> s[i];
	}

	int minn = abs(s[5] - s[1]);

	for (int i = 1; i < n; ++i)
	{
		int l;
		else
		{
			l = abs(s[i] - s[i+1]);
		}
		if (l < minn)
		{
			minn = l;
			s1 = i, s2 = i+1;
		}
	}

	cout << s1 << " " << s2;

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int a[100010];
int main(){
	int n;
	cin>>n;

	for(int i=1;i<=n;i++)cin>>a[i];
	int pla,minc=INT_MAX;

	for(int i=1;i<=n;i++){
		if(abs(a[i]-a[i%n+1])<minc){
			pla=i;
			minc=abs(a[i]-a[i%n+1]);
		}
	}
	cout<<pla<<' '<<pla%n+1<<endl;
	return 0;
}


#include"iostream"
#include"algorithm"
#include"cmath"
#include"cstdio"
#include"cstring"
#include"cstdlib"
#include"iomanip"//fixed<<
#include"queue"
#include"stack"
//#include<bits/stdc++.h>
using namespace std;
int n,a[105],ans,ans1,ans2;
int ab(int x){
	return x>0?x:-x;
}
int main(){
	//freopen(".in","r",stdin);
	//freopen(".out","w",stdout);
	scanf("%d",&n);
	for(int i=1;i<=n;i++){
		scanf("%d",&a[i]);
	}
	ans=abs(a[1]-a[n]);
    ans1=1,ans2=n;
	for(int i=1;i<n;i++){
		if(ab(a[i]-a[i+1])<ans){
			ans1=i;ans2=i+1;ans=ab(a[i]-a[i+1]);
		}
	}
	printf("%d %d",ans1,ans2);
	return 0;
}


//#include<bits/stdc++.h>
#include<iostream>
#include<iomanip>
#include<cstring>
#include<stack>
#include<vector>
//#include<conio.h>
#include<string>
#include<map>
#include<cstdlib>
#include<queue>
#include<math.h>
#include<time.h>
#include<set>
#include<cstdio>
#include<stdio.h>
#include<algorithm>
using namespace std;
using std::cin;
using std::cout;
using std::endl;
namespace IN{
    const int MAX_INPUT = 1000000;
    #define getc() (p1==p2&&(p2=(p1=buf)+inbuf->sgetn(buf,MAX_INPUT),p1==p2)?EOF:*p1++)
    char buf[MAX_INPUT],*p1,*p2;
    template<typename T>inline bool read(T &x) {
        static std::streambuf *inbuf=cin.rdbuf();
        x=0;
        register int f=0,flag=false;
        register char ch=getc();
        while(!isdigit(ch)){
            if (ch=='-') f=1;
        	ch=getc();
        }
        if(isdigit(ch)) x=x*10+ch-'0',ch=getc(),flag=true;
        while(isdigit(ch)) {
            x=x*10+ch-48;
            ch=getc();
        }
        x=f?-x:x;
        return flag;
    }
    template<typename T,typename ...Args>inline bool read(T& a,Args& ...args) {
       return read(a)&&read(args...);
    }
    #undef getc
}

namespace OUT{
    template<typename T>inline void put(T x){
        static std::streambuf *outbuf=cout.rdbuf();
        static char stack[21];
        static int top=0;
        if(x<0){
            outbuf->sputc('-');
            x=-x;
        }
        if(!x){
            outbuf->sputc('0');
            outbuf->sputc('\n');
            return;
        }
        while(x){
            stack[++top]=x%10+'0';
            x/=10;
        }
        while(top){
            outbuf->sputc(stack[top]);
            --top;
        }
        outbuf->sputc('\n');
    }
    inline void putc(const char ch){
        static std::streambuf *outbuf=cout.rdbuf();
        outbuf->sputc(ch);
    }
    inline void putstr(string s){
    	for(register int i=0;i<s.length();i++) putc(s[i]);
	}
    template<typename T>inline void put(const char ch,T x){
        static std::streambuf *outbuf=cout.rdbuf();
        static char stack[21];
        static int top = 0;
        if(x<0){
            outbuf->sputc('-');
            x=-x;
        }
        if(!x){
            outbuf->sputc('0');
            outbuf->sputc(ch);
            return;
        }
        while(x){
            stack[++top]=x%10+'0';
            x/=10;
        }
        while(top){
            outbuf->sputc(stack[top]);
            --top;
        }
        outbuf->sputc(ch);
    }
    template<typename T,typename ...Args> inline void put(T a,Args ...args){
        put(a);put(args...);
    }
    template<typename T,typename ...Args> inline void put(const char ch,T a,Args ...args){
        put(ch,a);put(ch,args...);
    }
}
using IN::read;
using OUT::put;
using OUT::putc;
using OUT::putstr;
int minn,n,p[1005],l,r;
int main(int argc, char const *argv[]){
    std::ios::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    read(n);
    for(int i=1;i<=n;i++) read(p[i]);
    minn=abs(p[n]-p[1]),l=n,r=1;
    for(int i=1;i<n;i++)
    	if(abs(p[i]-p[i+1])<minn)
    		minn=abs(p[i]-p[i+1]),l=i,r=i+1;
    put(' ',l,r);
    return 0;
}


#include <iostream>//输入输出流库
#include <cmath>//求绝对值的abs()所需的库
using namespace std;
int main(){
    int a[101]/*之前不小心开成100竟然没爆，可见这题数据良心，绝非毒瘤，可大胆尝试*/,n,minn=1001/*记录当前最小值*/,minx,miny;
    cin>>n;
    for(int i=1;i<=n;i++) cin>>a[i];
    for(int i=0;i<n;i++)
        if(minn>abs(a[i%n+1]-a[(i+1)%n+1])/*这样处理可以避免0的出现*/)
        {
            minn=abs(a[i%n+1]-a[(i+1)%n+1]);
            minx=i%n+1;
            miny=(i+1)%n+1;//三个赋值
        }
    cout<<minx<<" "<<miny<<endl;;//接着输出
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int i,n,a[1001],b,s,m;
int minn,mini;
int main()
{
    cin>>n;
    for(i=1;i<=n;i++)scanf("%d",&a[i]);
     minn=abs(a[1]-a[n]);m=n;s=1;
    for(i=1;i<n;i++)
    if(minn>abs(a[i]-a[i+1]))minn=abs(a[i]-a[i+1]),m=i,s=i+1;
    printf("%d %d\n",m,s);
    return 0;
}


#include <iostream>
#include <climits>
#include <cmath>
#pragma GCC optimize(2)
using namespace std;
int a[110];
int main()
{
	int n;
	cin >> n;
	for(int i = 1; i <= n; i++) {
		cin >> a[i];
	}
	for(int i = n - 1; i >= 2; i--) {
		a[i] = abs(a[i] - a[i - 1]);
	}
	a[1] = abs(a[1] - a[n]);
	a[n] = abs(a[n] - a[n - 1]);
	int ansx = a[1], x = n, y = 1;
	for(int i = 2; i <= n; i++) {
		if(a[i] < ansx) {
			ansx = a[i];
			x = i - 1;
			y = i;
		}
	}
	cout << x << " " << y;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin >> n;
    int s[n+2];
    for (int i = 1; i <= n; ++i)
    	 cin >> s[i];
	int minn = abs(s[n] - s[1]);
	int s1 = n, s2 = 1;
	for (int i = 1; i < n; ++i)
	{
		int l;
		l = abs(s[i] - s[i+1]);
		if (l < minn)
		{
			minn = l;
			s1 = i, s2 = i+1;
		}
	}

	cout << s1 << " " << s2；

    return 0;
}


#include<bits/stdc++.h>
#define M 105
using namespace std;
int n,a[M];
int main()
{
	scanf("%d",&n);
	int i,minn,step1,step2;
	for(i=1;i<=n;i++)
	 scanf("%d",&a[i]);
	minn=abs(a[2]-a[1]);step1=1;step2=2;
	for(i=1;i<=n;i++)
	 if(i!=n)
	 {
		if(abs(a[i]-a[i+1])<minn)
	    {
		    minn=abs(a[i]-a[i+1]);
		    step1=i;step2=i+1;
	    }
	 }
	 else if(abs(a[i]-a[1])<minn)
	      {
	    	minn=abs(a[i]-a[1]);
	    	step1=i;step2=1;
		  }
	printf("%d %d",step1,step2);
	return 0;
}