#include <bits/stdc++.h>

using namespace std;

const double PI = 3.14159265358979323846;
typedef long long ll;
const double EPS = 1e-9;
#define rep(i, n) for (int i = 0; i < (n); ++i)
//#define rep(i, n) for (ll i = 0; i < (n); ++i)
//typedef pair<ll, ll> P;
typedef pair<double, double> P;
const ll INF = 10e17;
#define cmin(x, y) x = min(x, y)
#define cmax(x, y) x = max(x, y)
#define ret() return 0;

double equal(double a, double b) {
    return fabs(a - b) < DBL_EPSILON;
}

std::istream &operator>>(std::istream &in, set<string> &o) {
    string a;
    in >> a;
    o.insert(a);
    return in;
}

std::istream &operator>>(std::istream &in, queue<int> &o) {
    ll a;
    in >> a;
    o.push(a);
    return in;
}

bool contain(set<int> &s, int a) { return s.find(a) != s.end(); }

//ofstream outfile("log.txt");
//outfile << setw(6) << setfill('0') << prefecture << setw(6) << setfill('0') << rank << endl;
// std::cout << std::bitset<8>(9);
//const ll mod = 1e10;

typedef priority_queue<ll, vector<ll>, greater<ll> > PQ_ASK;

int main() {
    int x, y;
    cin >> x >> y;

    auto f = [](int i) {
        if (i == 3) return 100000;
        if (i == 2) return 200000;
        if (i == 1) return 300000;
        return 0;
    };

    int ans = [&] {
        if (x == 1 && y == 1) return 1000000;
        return f(x) + f(y);
    }();
    cout << ans << endl;
}

#include<stdio.h>
#include<string.h>

int main(){
    int a,b,total=0;
	scanf("%d %d",&a,&b);
	
    char s[a+b+2];
    scanf("%s", &s);
    
    for(int i=0; i<a+b+1 ;i++){
        if(i!=a){
            if(s[i]>=48 && s[i]<=57){
                total++;
            } 
        } 
		else {
            if(s[i] == '-'){
                total++;
            }
        }
    }
    
    if (total==a+b+1){
    	printf("Yes");
	}
	else {
		printf("No");
	}
    
    return 0;
}