#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;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4gKCkgewoKCWludCBuLCB4LCB5OyBjaW4gPj4gbiA+PiB4ID4+IHk7CgoJc3RyaW5nIG51bTsKCgljaW4+PiBudW07CgoJaW50IGRpZ2l0c1sxMDAwMDAwXTsKCglmb3IgKGludCBpPTA7IGk8bjsgaSsrKSB7CgkJZGlnaXRzW2ldPW51bVtpXS0nMCc7Cgl9CgoJaWYgKGRpZ2l0c1t4LTFdJWRpZ2l0c1t5LTFdPT0wIHx8IGRpZ2l0c1t5LTFdJWRpZ2l0c1t4LTFdPT0wKSB7CgoJCWNvdXQgPDwgIllFUyIgPDwgZW5kbDsKCX0KCgllbHNlCgkJY291dCA8PCAiTk8iIDw8IGVuZGw7IAoKCgoKCn0=