#include<iostream> #include<map> #include<vector> using namespace std; map<int,int> mp; void dfs(const vector<int> & vec,int index,int start,int n) { if(start>=1 && start<=n) { if(index>=vec.size()) { mp[start]++; } else { dfs(vec,index+1,start+vec[index],n,count); dfs(vec,index+1,start-vec[index],n,count); } } } int main() { int n,m; cin>>n>>m; vector<int> vec; while (m--) { int tmp; cin>>tmp; vec.push_back(tmp); } for(int i=1;i<=n;i++) { dfs(vec,0,i,n); } cout<<mp.size(); }