#include <iostream>
#include <string>
using namespace std;
int main() {
long long n = 1;
int a = 0;
int d, e;
cin >> d >> e;
string target = to_string(d);
for (int i = 1; i <= e; i++) {
n *= 2;
string s = to_string(n);
if (s.find(target) != string::npos) {
a = 1;
break;
}
}
cout << a;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: