#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define whole(v) (v).begin(),(v).end() #define rwhole(v) (v).rbegin(),(v).rend() #define press(v) (v).erase(unique(whole(v)),(v).end()) #define Yes cout<<"Yes"< #define vll vector #define vpint vector> #define vvint vector> #define vvll vector> #define pqint priority_queue #define pqpint priority_queue> #define rpqint priority_queue,greater> #define rpqpint priority_queue,vector>,greater>> using namespace std; using ll = long long; int mod107 = 1000000007, mod998 = 998244353; string alphabet = "abcdefghijklmnopqrstuvwxyz", ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; //(a,b)と(c,d)の距離 double pyth(ll a, ll b, ll c, ll d) { double l = sqrt((a - c) * (a - c) + (b - d) * (b - d)); return l; } //aのb乗をmで割った余り(a,bは非負整数,mは自然数) int power(ll a, ll b, int m) { int k = 0, ans = 1; vector v(100); v[0] = a; for (int i = 1; i < 100; i++) v[i] = v[i - 1] * v[i - 1] % m; while (b > 0) { if (b % 2) ans = ans * v[k] % m; k++; b /= 2; } return ans; } //素数判定 O(sqrt(n)) bool prime_judge(ll n) { for (int i = 2; i <= sqrt(n); i++) { if (n % i == 0) { return false; } } return true; } int main() { int n, m, l; cin >> n >> m >> l; vint a(n); for (int i = 0; i < n; i++) { cin >> a[i]; } vector> dp(n + 1, vector(1001)); dp[0][l] = true; for (int i = 0; i < n; i++) { for (int j = 1; j < 1001; j++) { if (dp[i][j]) { dp[i + 1][(a[i] + j) / 2] = true; dp[i + 1][j] = true; } } } if (dp[n][m]) { Yes; } else { No; } }