提交时间:2025-01-23 15:32:52

运行 ID: 5173

#include <bits/stdc++.h> using namespace std; int main() { int n,m; while(cin>>n>>m) { int a[m]; int temp = 0; for(int i = 0;i < m;i++) { cin>>a[i]; temp += a[i]; } if(temp <= n) { cout<<"Yes"<<endl; } else { cout<<"No"<<endl; } } return 0; }