#include <iostream>
#include <string>
using namespace std;

int main () {

	int n, x, y; cin >> n >> x >> y;

	string num;

	cin>> num;

	int digits[1000000];

	for (int i=0; i<n; i++) {
		digits[i]=num[i]-'0';
	}

	if (digits[x-1]%digits[y-1]==0 || digits[y-1]%digits[x-1]==0) {

		cout << "YES" << endl;
	}

	else
		cout << "NO" << endl; 





}