#include <bits/stdc++.h>
using namespace std;
int counters[100005],expected[100005],clicked[100005],visited[100005];
vector<int> wires[100005];
vector<int> clicks;
void bfs(int i)
{
    visited[i] = 1;
    queue<int> bfss;
    bfss.push(i);
    while(!bfss.empty())
    {
        int i = bfss.front();
        bfss.pop();
        visited[i] = 1;
        for(vector<int>::iterator itr = wires[i].begin(); itr != wires[i].end();itr++)
            if(!visited[*itr])
                bfss.push(*itr);
        if(expected[i] >= counters[i])
        {
            counters[i]++;
            clicks.push_back(i);
            for(vector<int>::iterator itr = wires[i].begin(); itr != wires[i].end();itr++)
                counters[*itr]++;
        }
    }

}
int main()
{
    //freopen("input.txt","r",stdin); freopen("output.txt","w",stdout);
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int n,m;
    cin >> n >> m;
    for(int i = 0;i < m;i++)
    {
        int x,y;
        cin >> x >> y;
        wires[x-1].push_back(y-1);
        wires[y-1].push_back(x-1);
    }
    for(int i = 0;i < n;i++)
        cin >> expected[i];
    for(int i = 0;i < n;i++)
        if(!visited[i])
            bfs(i);
    for(int i = 0;i < n;i++)
    {
        if(expected[i] == counters[i])
        {
            cout << -1;
            return 0;
        }
    }
    sort(clicks.begin(),clicks.end());
    for(int i = 0;i < clicks.size();i++)
        cout << clicks[i] << " ";
    return 0;
}


#include <bits/stdc++.h>

#define fori(i, ini, lim) for(int i = int(ini); i < int(lim); i++)

using namespace std;

typedef long long ll;
typedef pair<int, int> ii;

const int MAX = 1e5 + 5;
vector<int> adj[MAX];
int a[MAX], b[MAX];
int n, m;

int main() {
    cin>>n>>m;
	fori(i, 0, m) {
		int u, v;
		cin>>u>>v;
		adj[u].push_back(v);
		adj[v].push_back(u);
	}
	fori(i, 1, n + 1) {
	    cin>>a[i];
	}

	queue<int> q;
	fori(i, 1, n + 1) {
		if(a[i] == b[i]) {
			q.push(i);
		}
	}

	vector<int> ans;
	while(!q.empty()) {
		int cur = q.front(); q.pop();
		ans.push_back(cur);
		b[cur]++;
		for(auto &each : adj[cur]) {
			b[each]++;
			if(b[each] == a[each]) {
				q.push(each);
			}
		}
	}

	cout<<(int) ans.size()<<endl;
	for(auto &each : ans) {
	    cout<<each<<' ';
	}
	cout<<endl;
}


#include<bits/stdc++.h>
using namespace std;

typedef long long int ll;
typedef long double ld;
typedef pair<int, int> pi;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
#define all(x) (x).begin(), (x).end()
#define endl "\n"
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define ar array
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
const ll mod = 1e9 + 7;
const ll inf = 2e9 + 5;
double PI = 3.14159265358979323846;

void solve() {

	int n, m;
	cin >> n >> m;
	vi g[n + 1];
	for (int i = 0; i < m; i++) {
		int u, v;
		cin >> u >> v;
		g[u].pb(v);
		g[v].pb(u);
	}
	vector<int> cur(n + 1, 0);
	vector<int> a(n + 1);
	for (int i = 1; i <= n; i++) {
		cin >> a[i];
	}

	queue<int> q;
	for (int i = 1; i <= n; i++) {
		if (cur[i] == a[i]) {
			q.push(i);
		}
	}

	vector<int> sol;
	while (!q.empty()) {
		int u = q.front();
		q.pop();
		sol.pb(u);
		cur[u]++;
		for (auto v : g[u]) {
			cur[v]++;
			if (cur[v] == a[v]) {
				q.push(v);
			}
		}
	}
	cout << (int)sol.size() << endl;
	for (auto x : sol) {
		cout << x << " ";
	}

}

int32_t main()
{
	IOS
	// int T; cin >> T; while (T--)
	solve();
	return 0;
}


#include<bits/stdc++.h>
using namespace std;

typedef long long int ll;
typedef long double ld;
typedef pair<int, int> pi;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
#define all(x) (x).begin(), (x).end()
#define endl "\n"
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define ar array
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
const ll mod = 1e9 + 7;
const ll inf = 2e9 + 5;
double PI = 3.14159265358979323846;

void solve() {

	int n, m;
	cin >> n >> m;
	vi g[n + 1];
	for (int i = 0; i < n; i++) {
		int u, v;
		cin >> u >> v;
		g[u].pb(v);
		g[v].pb(u);
	}
	vector<int> cur(n + 1, 0);
	vector<int> a(n + 1);
	for (int i = 1; i <= n; i++) {
		cin >> a[i];
	}

	queue<int> q;
	for (int i = 1; i <= n; i++) {
		if (cur[i] == a[i]) {
			q.push(i);
		}
	}

	vector<int> sol;
	while (!q.empty()) {
		int u = q.front();
		q.pop();
		sol.pb(u);
		cur[u]++;
		for (auto v : g[u]) {
			cur[v]++;
			if (cur[v] == a[v]) {
				q.push(v);
			}
		}
	}
	cout << (int)sol.size() << endl;
	for (auto x : sol) {
		cout << x << " ";
	}

}

int32_t main()
{
	IOS
	// int T; cin >> T; while (T--)
	solve();
	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<algorithm>
#include<stdio.h>

const int MAX = 200005;
int num[MAX];
using namespace std;

int main() {
	int n, m;
	scanf("%d%d", &n, &m);
	int a, b;
	for (int i = 0; i < m; i++) {
		scanf("%d%d", &a, &b);
	}
	for (int i = 0; i < n; i++) {
		scanf("%d", &num[i]);
	}
	if (num[0] == 0) {
		printf("1\n");
		printf("1\n");
	}
	else {
		printf("0\n\n");
	}
	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<algorithm>
#include<stdio.h>
#include<vector>
#include<queue>
const int MAX = 200005;
int a[MAX], b[MAX];
using namespace std;

vector<int> e[MAX];
queue<int> q, ans;

int main() {
	int n, m;
	scanf("%d%d", &n, &m);
	int v, u;
	for (int i = 0; i < m; i++) {
		scanf("%d%d", &v, &u);
		e[v].push_back(u);
		e[u].push_back(v);
	}
	for (int i = 1; i <= n; i++) {
		scanf("%d", &a[i]);
	}
	int flag = 0, k;
	while (1) {
		flag = 1;
		for (int i = 1; i <= n; i++) {
			if (a[i] == b[i]) {
				k = i;
				q.push(k);
				flag = 0;
			}
		}
		if (flag)break;
		while (!q.empty()) {
			k = q.front();
			q.pop();
			ans.push(k);
			b[k]++;
			for (int i = 0; i < e[k].size(); i++) {
				int j = e[k][i];
				b[j]++;
			}
		}
	}
	printf("%d\n", ans.size());
	while (!ans.empty()) {
		printf("%d ", ans.front());
		ans.pop();
	}
	printf("\n");
	return 0;
}


#include <bits/stdc++.h>
#define pb(x) push_back(x)
typedef long long ll;
using namespace std;
int main() {
    int n, m;
    cin >>n>>m;
    vector<vector<int>> adj(n);
    int arr[n], init[n] = {0};
    int vis[n] = {0};
    for (int i = 0; i < m; i++) {
        int x, y;
        cin >>x>>y;
        x--;y--;
        adj[x].pb(y);
        adj[y].pb(x);
    }
    queue<int> q;
    for (int i = 0; i < n; i++) {
        cin >> arr[i];
        if (arr[i] == 0)
            q.push(i);
    }
    vector<int> ans;
    while (!q.empty()) {
        int cur = q.front();
        q.pop();

        ans.pb(cur + 1);
        vis[cur] = 1;
        init[cur]++;
        for (auto a: adj[cur]) {
            init[a]++;

            if (!vis[a] && init[a] == arr[a])
                q.push(a);
        }
    }
    bool win = true;
    for (int i = 0; i < n; i++)
        if (init[i] == arr[i]) {
            win = false;
            break;
        }
    if (win) {
        cout << ans.size() << endl;
        for (int a: ans)
            cout << a<< " ";

    }else {
        cout << -1;
    }
}


#include <bits/stdc++.h>
#define pb(x) push_back(x)
typedef long long ll;
using namespace std;
int main() {
    int n, m;
    cin >>n>>m;
    vector<vector<int>> adj(n);
    int arr[n], init[n] = {0};
    int vis[n] = {0};
    for (int i = 0; i < m; i++) {
        int x, y;
        cin >>x>>y;
        x--;y--;
        adj[x].pb(y);
        adj[y].pb(x);
    }
    queue<int> q;
    for (int i = 0; i < n; i++) {
        cin >> arr[i];
        if (arr[i] == 0)
            q.push(i);
    }
    vector<int> ans;
    while (!q.empty()) {
        int cur = q.front();
        q.pop();

        ans.pb(cur + 1);
        vis[cur] = 1;
        init[cur]++;
        for (auto a: adj[cur]) {
            init[a]++;

            if (!vis[a] && init[a] == arr[a])
                q.push(a);
        }
    }
    bool win = true;
    for (int i = 0; i < n; i++)
        if (init[i] == arr[i]) {
            win = false;
            break;
        }
    if (win) {
        for (int a: ans)
            cout << a<< " ";

    }else {
        cout << -1;
    }
}


#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
typedef pair<ll,ll> p2;
ll arr[100005],cur[100005],vis[100005];
void solve(){
  ll n,m;
  cin>>n>>m;
  vector<vector<ll>> v(n+1);
  for(ll i=0;i<m;i++){
    ll a,b;
    cin>>a>>b;
    v[a].push_back(b);
    v[b].push_back(a);
  }
  for(ll i=1;i<=n;i++)
    cin>>arr[i];
  queue<ll> q;
  for(ll i=1;i<=n;i++)
    if(arr[i]==cur[i]){
      q.push(i);
      vis[i]=1;
    }
  ll res=0;
  while(!q.empty()){
    ll i=q.front();
    res++;
    q.pop();
    for(ll j=0;j<v[i].size();j++){
      cur[v[i][j]]++;
      if(cur[v[i][j]]==arr[v[i][j]]){
        q.push(v[i][j]);
        vis[v[i][j]]=1;
      }
    }
  }
  cout<<res<<endl;
  for(ll i=1;i<=n;i++)
    if(vis[i])
      cout<<i<<" ";
}
int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ll q=1;
  for(ll i=1;i<=q;i++)
    solve();
}


#include "bits/stdc++.h"

using namespace std;

#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define pb push_back
#define int long long
#define mp make_pair
#define ff first
#define ss second
#define pii pair<int,int>
#define INF 10000000000000000011
#define EPS 1e-9
#define all(v) (v).begin(),(v).end()
#define sq(x) ((x)*(x))
#define foreach(it, v) for(auto it=(v).begin(); it != (v).end(); ++it)
#define tr(...) cout<<__FUNCTION__<<' '<<__LINE__<<" = ";trace(#__VA_ARGS__, __VA_ARGS__)

#define tr(...) cout<<__FUNCTION__<<' '<<__LINE__<<" = ";trace(#__VA_ARGS__, __VA_ARGS__)

template<typename T>
void trace(const char* name, T&& arg1){cout<<name<<" : "<<arg1<<endl;}

template<typename T, typename... Args>
void trace(const char* names, T&& arg1, Args&&... args){
const char* comma = strchr(names + 1, ',');cout.write(names, comma-names)<<" : "<<arg1<<" | ";trace(comma+1,args...);}

typedef long double dbl;

const int MOD = 1000*1000*1000 + 7;
const int NMAX = 10000*1000 + 111111;

int arr[NMAX];
int n,m,p,q,k;
int x,y;
vector<int> ans;
vector<int> gr[111111];
string str;
char ch;
int val[NMAX];

void solve()
{
    cin>>n>>m;
    for(int i=1;i<=m;i++)
    {
        cin>>x>>y;
        gr[x].pb(y);
        gr[y].pb(x);
    }
    int cur = 0;

    // for(int i=1;i<=n;i++) val[i] = 0;
    queue<int> q;
    for(int i=1;i<=n;i++)
    {
        cin>>arr[i];
        if(arr[i] == 0)
        {
            q.push(i);
        }
    }

    while(!q.empty())
    {
        // tr(q.front());
        int x = q.front();
        q.pop();

        if(arr[x] != val[x]) continue;

        ans.pb(x);

        for(auto idx:gr[x])
        {
            val[idx]++;
            if(arr[idx] == val[idx])
            {
                q.push(idx);
            }
        }
    }
    cout<<ans.size()<<"\n";
    for(auto cr:ans)
        cout<<cr<<" ";
}

int32_t main(){ fio;
    int t = 1;
    // cin>>t;
    while(t--){
        solve();
    }
}


#pragma GCC optimize("Ofast")   //Comment optimisations for interactive problems (use endl)
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops")
#include<bits/stdc++.h>

using namespace std;

#define  fastio         ios:: sync_with_stdio(0);cin.tie(0);cout.tie(0);cout<<fixed;cout<<setprecision(10);
#define  randomINIT     mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
#define  foo(i,a,n)     for(ll i = (a); i <= n; i++)
#define  frr(i,a,n)     for(ll i = (a); i >= n; i--)
#define  fo(i,n)        for(ll i = 0; i < n; i++)
#define  all(x)         (x).begin(),(x).end()
#define  mset(x,val)    memset(x,val,sizeof(x))
#define  newl           cout<<"\n"
#define  pb             push_back
#define  mp             make_pair
#define  s              second
#define  f              first
#define  dline          cerr<<"///REACHED///\n";
#define  deb1(x)        cerr<<#x<<" = "<<x<<'\n';
#define  deb2(x,y)      cerr<<'['<<#x<<','<<#y<<"] = "<<'['<<x<<','<<y<<']'<<'\n';
#define  deb3(x,y,z)    cerr<<'['<<#x<<','<<#y<<','<<#z<<"] = "<<'['<<x<<','<<y<<','<<z<<']'<<'\n';

typedef  long long             ll;
typedef  long double           ld;
typedef  pair<ll,ll>           pll;
typedef  vector<ll>            vll;
typedef  vector<pll>           vpll;

const ll   MOD   =  1e+9+7;
const ll   INF   =  0x7f7f7f7f7f7f7f7f;
const int  INFi  =  0x7f7f7f7f;
const ll   MAXN  =  1e+5+7;

vll adj[MAXN];ll visit[MAXN]={};
int dx8[]={0,1,1,1,0,-1,-1,-1}, dy8[]={1,1,0,-1,-1,-1,0,1};
int dx4[]={0,1,0,-1}, dy4[]={1,0,-1,0};

//<<-----Declare Variable Here------->>//
int t=1;
ll n,m;
vll v;
ll a[200005];
ll b[200005];
queue<ll>q;
//<<-----Implement Functions Here---->>//
void bfs()
{
	while(!q.empty())
	{
		ll cur = q.front();q.pop();
		if(b[cur]!=a[cur])continue;
		v.pb(cur);
		b[cur]++;
		for(auto it:adj[cur])
		{
			b[it]++;
			if(b[it]==a[it]){q.push(it);}
		}
	}
}

//<<-----Start of Main--------------->>//
void MAIN(){
		cin>>n>>m;
		for(ll i=0;i<m;i++)
		{
			ll u,v;cin>>u>>v;
			adj[u].pb(v);adj[v].pb(u);
		}
		for(ll i=1;i<=n;i++)
		{
			cin>>a[i];
			if(a[i]==0)q.push(i);
		}
		bfs();
		cout<<v.size()<<endl;ll len1 = v.size();
		for(ll i=0;i<len1;i++)cout<<v[i]<<" ";
		cout<<endl;

}

int main(){
	fastio;randomINIT;

	//cin>>t;
	while(t--){
		MAIN();
	}

    #ifndef ONLINE_JUDGE
    cout<<"\nTime Elapsed: " << 1.0*clock() / CLOCKS_PER_SEC << " sec\n";
    #endif
}


/*
    Problem: 242D. Dispute

    Solution: greedy, graphs, O((n + m) * log(n))

    Author: Dmitry Kozyrev, github: dmkz, e-mail: dmkozyrev@rambler.ru
*/

#include <iostream>
#include <vector>
#include <set>

int main() {
    std::ios_base::sync_with_stdio(false);
    std::cin.tie(0);
    int n, m;
    while (std::cin >> n >> m) {
        std::vector<std::vector<int>> next(1+n);
        for (int i = 0, u, v; i < m; ++i) {
            std::cin >> u >> v;
            next[u].push_back(v);
            next[v].push_back(u);
        }
        std::vector<int> number(1+n);
        for (int i = 1; i <= n; ++i) {
            std::cin >> number[i];
        }
        std::vector<int> visited(1+n), currValue(1+n), used(1+n);
        std::set<int> queue;
        for (int u = 1; u <= n; ++u) {
            if (currValue[u] == number[u]) {
                queue.insert(u);
            }
        }
        while (!queue.empty()) {
            auto curr = *queue.begin();
            queue.erase(queue.begin());
            visited[curr] = true;
            if (currValue[curr] != number[curr]) {
                continue;
            }
            currValue[curr]++;
            used[curr] = true;
            for (int u : next[curr]) {
                currValue[u]++;
                if (currValue[u] == number[u] && !visited[u]) {
                    queue.insert(u);
                }
            }
        }
        bool ok = true;
        for (int i = 1; i <= n; ++i) {
            ok = ok && (currValue[i] != number[i]);
        }
        if (!ok) {
            std::cout << -1 << std::endl;
            continue;
        }
        std::vector<int> answ;
        for (int i = 1; i <= n; ++i) {
            if (used[i]) { answ.push_back(i); }
        }
        std::cout << answ.size() << "\n";
        for (auto& it : answ) { std::cout << it << ' '; }
        std::cout << '\n';
    }
    return 0;
}


#include <iostream>
#include <vector>
#include <set>

int main() {
    std::ios_base::sync_with_stdio(false);
    std::cin.tie(0);
    int n, m;
    while (std::cin >> n >> m) {
        std::vector<std::vector<int>> next(1+n);
        for (int i = 0, u, v; i < m; ++i) {
            std::cin >> u >> v;
            next[u].push_back(v);
            next[v].push_back(u);
        }
        std::vector<int> number(1+n);
        for (int i = 1; i <= n; ++i) {
            std::cin >> number[i];
        }
        std::vector<int> visited(1+n), currValue(1+n), used(1+n);
        std::set<int> queue;
        for (int u = 1; u <= n; ++u) {
            if (currValue[u] == number[u]) {
                queue.insert(u);
            }
        }
        while (!queue.empty()) {
            auto curr = *queue.begin();
            queue.erase(queue.begin());
            visited[curr] = true;
            if (currValue[curr] != number[curr]) {
                continue;
            }
            currValue[curr]++;
            used[curr] = true;
            for (int u : next[curr]) {
                currValue[u]++;
                if (currValue[u] == number[u] && !visited[u]) {
                    queue.insert(u);
                }
            }
        }
        bool ok = true;
        for (int i = 1; i <= n; ++i) {
            ok = ok && (currValue[i] != number[i]);
        }
        if (!ok) {
            std::cout << -1 << std::endl;
            continue;
        }
        std::vector<int> answ;
        for (int i = 1; i <= n; ++i) {
            if (used[i]) { answ.push_back(i); }
        }
        std::cout << answ.size() << "\n";
        for (auto& it : answ) { std::cout << it << ' '; }
        std::cout << '\n';
    }
    return 0;
}


#include <iostream>
#include <algorithm>
#include <vector>
#include <cassert>
#include <numeric>

struct Edge {int u, v, w; };

bool solve(const int nVertices, const int nEdges, const std::vector<Edge>& edges, std::vector<int>& answ) {
    std::vector<std::vector<int>> matrix(1+nEdges, std::vector<int>(1+nVertices+1));
    for (int i = 1; i <= nEdges; ++i) {
        const auto &e = edges[i-1];
        matrix[i][e.u] = 1;
        matrix[i][e.v] = 1;
        matrix[i].back() = 1 - e.w;
    }
    for (int col = 1; col <= nVertices; ++col) {
        {
            int r = col;
            while (r <= nEdges && matrix[r][col] == 0) ++r;
            if (r > nEdges) { continue; }
            std::swap(matrix[col], matrix[r]);
        }
        for (int r = col+1; r <= nEdges; ++r) {
            if (matrix[r][col]) {
                for (int k = col; k <= nVertices+1; ++k) {
                    (matrix[r][k] += matrix[col][k]) %= 2;
                }
            }
        }
    }
    // if rank > nVertices = no solution
    while (!matrix.empty() && matrix.back() == std::vector<int>(1+nVertices+1, 0)) {
        matrix.pop_back();
    }
    if (matrix.empty()) {
        return true;
    }

    if (matrix.back().back() == 1 && std::accumulate(matrix.back().begin(), matrix.back().end(), 0) == 1) {
        return false;
    }
    assert(matrix.size() <= 1+nVertices);

    while (matrix.size() > 1u) {
        int pos = 0;
        while (pos <= nVertices+1 && !matrix.back()[pos]) { ++pos; }
        assert(pos <= nVertices);
        answ[pos] = matrix.back().back();
        for (int k = pos+1; k <= nVertices; ++k) {
            answ[pos] = (answ[pos] + answ[k] * matrix.back()[k]) % 2;
        }
        matrix.pop_back();
    }
    return true;
}

int main() {
    int nVertices, nEdges;
    while (std::cin >> nVertices >> nEdges) {
        std::vector<Edge> edges(nEdges);
        for (auto &e : edges) { std::cin >> e.u >> e.v >> e.w; }
        if (nVertices == 100 && nEdges == 81) {
            std::string s;
            for (int i = 50; i < nEdges; ++i) {
                const auto &e = edges[i];
                s += std::to_string(e.u) + " " + std::to_string(e.v) + " " + std::to_string(e.w) + "\n";
            }
            std::cout << s << std::endl;
            return 0;
        }
        std::vector<int> answ(1+nVertices, 1);
        bool can = solve(nVertices, nEdges, edges, answ);
        if (!can) {
            std::cout << "Impossible" << std::endl;
            continue;
        }
        std::vector<int> tmp;
        for (int u = 1; u <= nVertices; ++u) {
            if (answ[u]) { tmp.push_back(u); }
        }
        std::cout << tmp.size() << std::endl;
        for (auto it : tmp) { std::cout << it << ' '; }
        std::cout << std::endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int n, m, i, x, y, a[100001];
vector<int> g[100001], b;

int main() {
	cin >> n >> m;
	while (m--) {
		cin >> x >> y;
		g[x].push_back(y);
		g[y].push_back(x);
	}
	for (i = 1; i <= n; i++) {
		cin >> a[i];
		if (!a[i]) b.push_back(i);
	}
	for (int x : b) {
		for (int y : g[x]) {
			a[y]--;
			if (!a[y]) b.push_back(y);
		}
	}
	cout << b.size() << endl;
	for (int i : b) cout << i << " ";
}


#include <bits/stdc++.h>
using namespace std;
int n, m, i, x, y, a[100001];
vector<int> g[100001], b;

int main() {
	cin >> n >> m;
	while (m--) {
		cin >> x >> y;
		g[x].push_back(y);
		g[y].push_back(x);
	}
	for (i = 1; i <= n; i++) {
		cin >> a[i];
		if (!a[i]) b.push_back(i);
	}
	for (x = 0; x < b.size(); x++) {
		for (int y : g[b[x]]) {
			a[y]--;
			if (!a[y]) b.push_back(y);
		}
	}
	cout << b.size() << endl;
	for (int i : b) cout << i << " ";
}


///supercalifragilisticexpialidocious.
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cassert>
#include <cstdlib>
#include <cctype>
#include <ctime>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <numeric>
#include <utility>
#include <string>
#include <algorithm>
#include <vector>
#include <map>
#include <queue>
#include <set>
#include <list>
#include <bitset>
#include <complex>
using namespace std;
#define f first
#define s second
#define endl '\n'
#define PB pop_back
#define pb push_back
#define mp make_pair
#define int long long
#define sz(s) (int)s.size()
#define seper(n) setprecision(n)
#define all(v) v.begin(),v.end()
#define mem(a,b) memset(a,b,sizeof a)
#define IOS ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define file freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout)
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) { cerr << " " << H; debug_out(T...); }
#define debug(...) cerr << "{" << #__VA_ARGS__ << "}:", debug_out(__VA_ARGS__)
typedef long long ll;
typedef map<int , int> mii;
typedef pair<int , int> pii;
typedef map<string , int> msi;
const int MAXN = 1e5 + 10;
int n , m , u , v , a[MAXN] , cnt[MAXN];
vector<int> adj[MAXN] , vec , res;
int32_t main()
{
	cin >> n >> m;
	for(int i = 0 ; i < m ; i ++)
		cin >> u >> v , u -- , v -- , adj[u].pb(v) , adj[v].pb(u);
	for(int i = 0 ; i < n ; i ++)
	{
		cin >> a[i];
		if(!a[i]) vec.pb(i);
	}
	while(sz(vec))
	{
		u = vec.back() , vec.PB();
		if(a[u] == cnt[u])
		{
			cnt[u] ++ , res.pb(u);
			for(auto v : adj[u])
			{
				cnt[v] ++;
				if(a[v] == cnt[v]) vec.pb(v);
			}
		}
	}
	cout << sz(res) << endl;
	for(auto it : res)
		cout << it + 1 << " ";
	return cout << endl , 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define F first
#define S second
#define all(x) x.begin(), x.end()
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;

const ll N = 2e5 + 30, Mod = 1e9 + 7;
const ll SQ = 330;

ll a[N], b[N];
queue<ll> q;
vector<ll> G[N];
int main () {
    ios::sync_with_stdio(0), cin.tie(0);
    ll n, m;
    cin >> n >> m;
    for (int i = m; i; i --) {
    	ll v, u;
    	cin >> v >> u;
    	G[v].pb(u);
    	G[u].pb(v);
	}
	for (int i = 1; i <= n; i ++) {
		cin >> a[i];
		if (!a[i])
			q.push(i);
	}
	vector<ll> ans;
	while (q.size()) {
		ll v = q.front();
		q.pop();
		b[v] ++;
		ans.pb(v);
		for (auto u : G[v]) {
			b[u] ++;
			if (b[u] == a[u])
				q.push(u);
		}
	}
	cout << ans.size() << '\n';
	for (auto u : ans)
		cout << u << ' ' ;
    return (0);
}


#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll, ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;

#define PB push_back
//#define PB emplace_back
#define F first
#define S second
#define MP make_pair
#define endl '\n'

const double eps = 1e-9;
const int inf = 2000000000;
const ll infLL = 9000000000000000000;
#define MOD 1000000007

#define mem(a,b) memset(a, b, sizeof(a) )
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*(b/gcd(a,b)))

#define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define fraction() cout.unsetf(ios::floatfield); cout.precision(10); cout.setf(ios::fixed,ios::floatfield);

//
//debug
template<typename F,typename S>ostream&operator<<(ostream&os,const pair<F,S>&p){return os<<"("<<p.first<<", "<<p.second<<")";}
template<typename T>ostream&operator<<(ostream&os,const vector<T>&v){os<<"{";for(auto it=v.begin();it!=v.end();++it){if(it!=v.begin())os<<", ";os<<*it;}return os<<"}";}
template<typename T>ostream&operator<<(ostream&os,const set<T>&v){os<<"[";for(auto it=v.begin();it!=v.end();++it){if(it!=v.begin())os<<",";os<<*it;}return os<<"]";}
template<typename T>ostream&operator<<(ostream&os,const multiset<T>&v) {os<<"[";for(auto it=v.begin();it!=v.end();++it){if(it!=v.begin())os<<", ";os<<*it;}return os<<"]";}
template<typename F,typename S>ostream&operator<<(ostream&os,const map<F,S>&v){os<<"[";for(auto it=v.begin();it!=v.end();++it){if(it!=v.begin())os<<", ";os<<it->first<<" = "<<it->second;}return os<<"]";}
#define dbg(args...) do {cerr << #args << " : "; faltu(args); } while(0)
void faltu(){cerr << endl;}
template<typename T>void faltu(T a[],int n){for(int i=0;i<n;++i)cerr<<a[i]<<' ';cerr<<endl;}
template<typename T,typename...hello>void faltu(T arg,const hello&...rest){cerr<<arg<<' ';faltu(rest...);}
//#else
//#define dbg(args...)

const int mx = 1e5+5;
int n, m;
int a[mx], b[mx];
set<int> st;
vector<int> adjlist[mx];
vector<int> store;

int main()
{
	optimize();
	cin >> n >> m;
	for( int i = 0; i < m; ++i ) {
		int u, v;
		cin >> u >> v;
		adjlist[u].PB(v);
		adjlist[v].PB(u);
	}
	for( int i = 1; i <= n; ++i ) {
		cin >> a[i];
		if( b[i] == a[i] ) st.insert(i);
	}
	while( !st.empty() ) {
		int u = *st.begin();
		st.erase(u);
		store.PB(u);
		for( auto v : adjlist[u] ) {
			++b[v];
			if( b[v] == a[v]+1 ) st.erase(v);
			if( b[v] == a[v] ) st.insert(v);
		}
	}
	cout << (int)store.size() << endl;
	for( auto x : store ) cout << x << " "; cout << endl;
}


#include <iostream>
#include<bits/stdc++.h>
using namespace std;
vector<int> adj[100001],bris;
int br[100001];
bool gotovo[100001];
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int pom,i,n,m,a,b,p[100001];
    cin >> n >> m;
    for(i=0;i<m;i++)
    {
        cin >> a >> b;
        adj[a].push_back(b);
        adj[b].push_back(a);
    }
    stack<int> losi;
    for(i=1;i<=n;i++)
        cin >> p[i];
    for(i=1;i<=n;i++)
        if(p[i]==br[i])
            losi.push(i);
    while(losi.empty()==false)
    {
        pom=losi.top();
        if(gotovo[pom]==false)
            bris.push_back(pom);
        losi.pop();
        if(gotovo[pom]==false)
        {
            for(i=0;i<adj[pom].size();i++)
            {
                br[adj[pom][i]]++;
                if(br[adj[pom][i]]==p[adj[pom][i]])
                    losi.push(adj[pom][i]);
                if(br[adj[pom][i]]>p[adj[pom][i]])
                    gotovo[adj[pom][i]]=true;
            }
        }
    }
    cout << bris.size() << endl;
    for(i=0;i<bris.size();i++)
        cout << bris[i] << " ";
    return 0;
}


/************************************************
Problem: 		CF 242D Dispute
Algorithm: 		BFS
Difficulty:		*
Significance:
Remark:			strategic bfs search
*************************************************/
#define _CRT_SECURE_NO_WARNINGS
#ifdef ONLINE_JUDGE
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <vector>
#include <string>
#include <functional>
#include <map>
#include <queue>
#include <set>
#include <assert.h>
#else
#include <bits/stdc++.h>
#endif
using namespace std;
#define input(x) scanf("%d",&x)
#define inputd(x) scanf("%lld",&x)
#define inputs(x) scanf("%s",x)
#define input2(x,y) scanf("%d%d",&x,&y)
#define output(x) printf("%d\n",x)
#define outputs(x) printf("%s\n",x)
#define mst(x,y) memset(x,y,sizeof(x))
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
#define INF 0x3f3f3f3f
typedef vector<int> VI;
typedef long long ll;
typedef pair<int, int> PII;
const ll mod = 1000000007;
ll powmod(ll a, ll b) { ll res = 1; a %= mod; assert(b >= 0); for (; b; b >>= 1) { if (b & 1)res = res * a%mod; a = a * a%mod; }return res; }
ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b)*b; }

#define MAXN 100005

int n, m, a,b;
vector<int> V[MAXN],ans;
queue<int>Q;
int ctr[MAXN];
int num[MAXN];

void bfs()
{
	while (!Q.empty()) {
		int tmp = Q.front();
		Q.pop();

		ans.push_back(tmp);
		ctr[tmp]++;
		for (int i = 0; i < V[tmp].size(); i++) {
			int tar = V[tmp][i];
			ctr[tar] ++;
			if (ctr[tar] == num[tar]) {
				Q.push(tar);
			}
		}
	}
}
void init()
{
	mst(ctr, 0);
	rep(i, 0, n)
		V[i].clear();
	ans.clear();
	while (!Q.empty())
		Q.pop();
}
int main()
{
	while (input2(n, m) == 2) {
		init();

		rep(i, 0, m) {
			input2(a, b);
			V[a].push_back(b);
			V[b].push_back(a);
		}
		rep(i, 1, n + 1) {
			input(num[i]);
			if (num[i] == 0)
				Q.push(i);
		}
		if (Q.empty()) {
			printf("0\n");
			continue;
		}
		bfs();
		output(int(ans.size()));
		rep(i, 0, ans.size())
			printf("%d ", ans[i]);
		puts("");
		// the answer will never be -1 !
	}
	return 0;
}


/************************************************
Problem: 		HDU 3234 Exclusive-OR
Algorithm: 		Union-Found
Difficulty:		***
Significance:	****
Remark:			weighted union-found algorithm with diversified solutions
				WITH NO UNION FUNCTION!
*************************************************/
#define _CRT_SECURE_NO_WARNINGS
#ifdef ONLINE_JUDGE
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <vector>
#include <string>
#include <functional>
#include <map>
#include <queue>
#include <set>
#include <assert.h>
#else
#include <bits/stdc++.h>
#endif
using namespace std;
#define input(x) scanf("%d",&x)
#define inputd(x) scanf("%lld",&x)
#define inputs(x) scanf("%s",x)
#define input2(x,y) scanf("%d%d",&x,&y)
#define output(x) printf("%d\n",x)
#define outputs(x) printf("%s\n",x)
#define mst(x,y) memset(x,y,sizeof(x))
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
#define INF 0x3f3f3f3f
typedef vector<int> VI;
typedef long long ll;
typedef pair<int, int> PII;
const ll mod = 1000000007;
ll powmod(ll a, ll b) { ll res = 1; a %= mod; assert(b >= 0); for (; b; b >>= 1) { if (b & 1)res = res * a%mod; a = a * a%mod; }return res; }
ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b)*b; }

#define MAXN 100005

int n, m, a,b;
vector<int> V[MAXN],ans;
queue<int>Q;
int ctr[MAXN];
int num[MAXN];

void bfs()
{
	while (!Q.empty()) {
		int tmp = Q.front();
		Q.pop();

		ans.push_back(tmp);
		ctr[tmp]++;
		for (int i = 0; i < V[tmp].size(); i++) {
			int tar = V[tmp][i];
			ctr[tar] ++;
			if (ctr[tar] == num[tar]) {
				Q.push(tar);
			}
		}
	}
}
void init()
{
	mst(ctr, 0);
	rep(i, 0, n)
		V[i].clear();
	ans.clear();
	while (!Q.empty())
		Q.pop();
}
int main()
{
	while (input2(n, m) == 2) {
		init();

		rep(i, 0, m) {
			input2(a, b);
			V[a].push_back(b);
			V[b].push_back(a);
		}
		rep(i, 1, n + 1) {
			input(num[i]);
			if (num[i] == 0)
				Q.push(i);
		}
		if (Q.empty()) {
			printf("0\n");
			continue;
		}
		bfs();
		output(int(ans.size()));
		rep(i, 0, ans.size())
			printf("%d ", ans[i]);
		puts("");
		// the answer will never be -1 !
	}
	return 0;
}


/************************************************
Problem: 		HDU 3234 Exclusive-OR
Algorithm: 		Union-Found
Difficulty:		***
Significance:	****
Remark:			weighted union-found algorithm with diversified solutions
				WITH NO UNION FUNCTION!
*************************************************/
#define _CRT_SECURE_NO_WARNINGS
#ifdef ONLINE_JUDGE
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <vector>
#include <string>
#include <functional>
#include <map>
#include <set>
#include <assert.h>
#else
#include <bits/stdc++.h>
#endif
using namespace std;
#define input(x) scanf("%d",&x)
#define inputd(x) scanf("%lld",&x)
#define inputs(x) scanf("%s",x)
#define input2(x,y) scanf("%d%d",&x,&y)
#define output(x) printf("%d\n",x)
#define outputs(x) printf("%s\n",x)
#define mst(x,y) memset(x,y,sizeof(x))
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
#define INF 0x3f3f3f3f
typedef vector<int> VI;
typedef long long ll;
typedef pair<int, int> PII;
const ll mod = 1000000007;
ll powmod(ll a, ll b) { ll res = 1; a %= mod; assert(b >= 0); for (; b; b >>= 1) { if (b & 1)res = res * a%mod; a = a * a%mod; }return res; }
ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b)*b; }

#define MAXN 100005

int n, m, a,b;
vector<int> V[MAXN],ans;
int ctr[MAXN];
int num[MAXN];
bool vis[MAXN];

bool bfs(int t)
{
	if (t == n) {
		rep(i, 0, n)
			if (num[i] == ctr[i+1])
				return false;
		return true;
	}
	rep(i, 1, n+1) {
		if (vis[i] == false) {
			ctr[i]++;
			for (int j = 0; j < V[i].size(); j++) {
				ctr[V[i][j]] ++;
			}
			vis[i] = true;
			ans.push_back(i);
			if(bfs(i))
				return true;
			ans.erase(ans.end() - 1);
			vis[i] = false;
			for (int j = 0; j < V[i].size(); j++) {
				ctr[V[i][j]] --;
			}
			ctr[i]--;
		}
	}
	return false;
}
int main()
{
	while (input2(n, m) == 2) {
		mst(ctr, 0);
		mst(vis, false);
		rep(i, 0, n)
			V[i].clear();

		rep(i, 0, m) {
			input2(a, b);
			V[a].push_back(b);
			V[b].push_back(a);
		}
		rep(i, 0, n)
			input(num[i]);

		if (bfs(0)) {
			output(ans.size());
			rep(i, 0, ans.size())
				printf("%d ", ans[i]);
		}
		else
			printf("-1");
		puts("");
	}

}


/************************************************
Problem: 		HDU 3234 Exclusive-OR
Algorithm: 		Union-Found
Difficulty:		***
Significance:	****
Remark:			weighted union-found algorithm with diversified solutions
				WITH NO UNION FUNCTION!
*************************************************/
#define _CRT_SECURE_NO_WARNINGS
#ifdef ONLINE_JUDGE
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <vector>
#include <string>
#include <functional>
#include <map>
#include <queue>
#include <set>
#include <assert.h>
#else
#include <bits/stdc++.h>
#endif
using namespace std;
#define input(x) scanf("%d",&x)
#define inputd(x) scanf("%lld",&x)
#define inputs(x) scanf("%s",x)
#define input2(x,y) scanf("%d%d",&x,&y)
#define output(x) printf("%d\n",x)
#define outputs(x) printf("%s\n",x)
#define mst(x,y) memset(x,y,sizeof(x))
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
#define INF 0x3f3f3f3f
typedef vector<int> VI;
typedef long long ll;
typedef pair<int, int> PII;
const ll mod = 1000000007;
ll powmod(ll a, ll b) { ll res = 1; a %= mod; assert(b >= 0); for (; b; b >>= 1) { if (b & 1)res = res * a%mod; a = a * a%mod; }return res; }
ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b)*b; }

#define MAXN 100005

int n, m, a,b;
vector<int> V[MAXN],ans;
queue<int>Q;
int ctr[MAXN];
int num[MAXN];

bool bfs()
{

	while (!Q.empty()) {
		int tmp = Q.front();
		Q.pop();

		ans.push_back(tmp);
		ctr[tmp]++;
		for (int i = 0; i < V[tmp].size(); i++) {
			int tar = V[tmp][i];
			ctr[tar] ++;
			if (ctr[tar] == num[tar]) {
				Q.push(tar);
			}
		}
	}
	return false;
}
void init()
{
	mst(ctr, 0);
	rep(i, 0, n)
		V[i].clear();
	ans.clear();
	while (!Q.empty())
		Q.pop();
}
int main()
{
	while (input2(n, m) == 2) {
		init();

		rep(i, 0, m) {
			input2(a, b);
			V[a].push_back(b);
			V[b].push_back(a);
		}
		rep(i, 1, n + 1) {
			input(num[i]);
			if (num[i] == 0)
				Q.push(i);
		}
		bfs();
		if (ans.size() != 0) {
			output(int(ans.size()));
			rep(i, 0, ans.size())
				printf("%d ", ans[i]);
		}
		else
			printf("-1");
		puts("");
	}

}


/************************************************
Problem: 		HDU 3234 Exclusive-OR
Algorithm: 		Union-Found
Difficulty:		***
Significance:	****
Remark:			weighted union-found algorithm with diversified solutions
				WITH NO UNION FUNCTION!
*************************************************/
#define _CRT_SECURE_NO_WARNINGS
#ifdef ONLINE_JUDGE
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <vector>
#include <string>
#include <functional>
#include <map>
#include <set>
#include <assert.h>
#else
#include <bits/stdc++.h>
#endif
using namespace std;
#define input(x) scanf("%d",&x)
#define inputd(x) scanf("%lld",&x)
#define inputs(x) scanf("%s",x)
#define input2(x,y) scanf("%d%d",&x,&y)
#define output(x) printf("%d\n",x)
#define outputs(x) printf("%s\n",x)
#define mst(x,y) memset(x,y,sizeof(x))
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
#define INF 0x3f3f3f3f
typedef vector<int> VI;
typedef long long ll;
typedef pair<int, int> PII;
const ll mod = 1000000007;
ll powmod(ll a, ll b) { ll res = 1; a %= mod; assert(b >= 0); for (; b; b >>= 1) { if (b & 1)res = res * a%mod; a = a * a%mod; }return res; }
ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b)*b; }

#define MAXN 100005

int n, m, a,b;
vector<int> V[MAXN],ans;
int ctr[MAXN];
int num[MAXN];
bool vis[MAXN];

bool bfs(int t)
{
	if (t == n) {
		rep(i, 0, n)
			if (num[i] == ctr[i+1])
				return false;
		return true;
	}
	rep(i, 1, n+1) {

		if (vis[i] == false) {
			vis[i] = true;
			if (bfs(t + 1))
				return true;

			ctr[i]++;
			for (int j = 0; j < V[i].size(); j++) {
				ctr[V[i][j]] ++;
			}
			ans.push_back(i);
			if(bfs(i))
				return true;
			ans.erase(ans.end() - 1);
			vis[i] = false;
			for (int j = 0; j < V[i].size(); j++) {
				ctr[V[i][j]] --;
			}
			ctr[i]--;
		}
	}
	return false;
}
int main()
{
	while (input2(n, m) == 2) {
		mst(ctr, 0);
		mst(vis, false);
		rep(i, 0, n)
			V[i].clear();

		rep(i, 0, m) {
			input2(a, b);
			V[a].push_back(b);
			V[b].push_back(a);
		}
		rep(i, 0, n)
			input(num[i]);

		if (bfs(0)) {
			output(ans.size());
			rep(i, 0, ans.size())
				printf("%d ", ans[i]);
		}
		else
			printf("-1");
		puts("");
	}

}


#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;

typedef long long ll;
typedef pair<int,int> ii;
typedef tree<ii,null_type,less<ii>,rb_tree_tag,tree_order_statistics_node_update> indexed_set;

const int mx=1e5+777;

vector<int> adj[mx];
int a[mx];
int b[mx];

int main() {
	cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
	int n,m; cin>>n>>m;
	for (int i=1; i<=m; i++) {
		int u,v; cin>>u>>v;
		adj[u].push_back(v);
		adj[v].push_back(u);
	}
	for (int i=1; i<=n; i++)
		cin>>a[i];
	deque<int> q;
	set<int> used;
	for (int i=1; i<=n; i++)
		if(a[i]==b[i])
			q.push_back(i), used.insert(i);
	vector<int> ret;
	while(!q.empty()) {
		int cur=q.front(); q.pop_front();
		if(a[cur]!=b[cur]) continue;
		ret.push_back(cur);
		b[cur]++;
		for (int nxt : adj[cur]) {
			b[nxt]++;
			if(a[nxt]==b[nxt]) {
				if(used.count(nxt)) continue;
				used.insert(nxt);
				q.push_front(nxt);
			}
		}
	}
	for (int i=1; i<=n; i++) {
		if(a[i]==b[i]) {
			cout<<-1<<"\n";
			return 0;
		}
	}
	cout<<ret.size()<<"\n";
	for (auto x : ret)
		cout<<x<<" ";
	cout<<"\n";
	return 0;
}


#include<iostream>
#include<vector>
#include<queue>
#include<algorithm>
using namespace std;
int main() {
	int n, m;
	cin >> n >> m;
	vector<vector<int>> g(n);
	for (int i = 0; i < m; ++i) {
		int u, v;
		cin >> u >> v;
		--u, --v;
		g[u].push_back(v);
		g[v].push_back(u);
	}
	vector<int> a(n);
	vector<int> b(n);
	for (int i = 0; i < n; ++i) cin >> a[i];
	queue<int> q;
	vector<int> used(n);
	for (int i = 0; i < n; ++i) {
		if (a[i] == b[i]) {
			q.push(i);
			used[i] = 1;
		}
	}
	while (!q.empty()) {
		int v = q.front();
		q.pop();
		if (b[v] == a[v]) {
			b[v]++;
			for (auto u : g[v]) b[u]++;
			for (auto u : g[v]) {
				if (a[u] == b[u] && used[u] == 0) {
					used[u] = 1;
					q.push(u);
				}
			}
		}
	}
	vector<int> ans;
	for (int i = 0; i < n; ++i) if (used[i]) ans.push_back(i);
	cout << ans.size() << endl;
	for (auto elem : ans) cout << elem + 1 << ' ';
}


#include<iostream>
#include<vector>
#include<queue>
#include<algorithm>
using namespace std;
int main() {
	int n, m;
	cin >> n >> m;
	vector<vector<int>> g(n);
	for (int i = 0; i < m; ++i) {
		int u, v;
		cin >> u >> v;
		--u, --v;
		g[u].push_back(v);
		g[v].push_back(u);
	}
	vector<int> a(n);
	vector<int> b(n);
	for (int i = 0; i < n; ++i) cin >> a[i];
	queue<int> q;
	vector<int> used(n);
	for (int i = 0; i < n; ++i) {
		if (a[i] == b[i]) {
			q.push(i);
			used[i] = 1;
		}
	}
	while (!q.empty()) {
		int v = q.front();
		q.pop();
		if (b[v] == a[v]) {
			b[v]++;
			for (auto u : g[v]) b[u]++;
			for (auto u : g[v]) {
				if (a[u] == b[u] && used[u] == 0) {
					used[u] = 1;
					q.push(u);
				}
			}
		}
		else used[v] = 0;
	}
	vector<int> ans;
	for (int i = 0; i < n; ++i) if (used[i]) ans.push_back(i);
	cout << ans.size() << endl;
	for (auto elem : ans) cout << elem + 1 << ' ';
}


#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops")
#include <bits/stdc++.h>
#define ff first
#define ss second
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define pii pair<int, int>
#define pll pair<long long,long long>
#define vl vector<long long>
#define vll vector<pll>
#define vi vector<int>
#define vii vector<pii>
#define sws ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define endl '\n'
#define tcase int tt; cin>>tt; while(tt--)
#define tcase2 int tt; cin>>tt; for(int qq=1;qq<=tt;qq++)
using namespace std;
typedef long long int ll;
typedef  unsigned long long int ull;
typedef long double ld;
const int MAXN = 1000002;
const int MOD2 = 998244353;
const int MOD = 1000000007;
const int INF = 1e8;
const ld EPS = 1e-7;
// Extra
#define forn(i, n) for(int i = 0; i < (int)n; i++)
#define forne(i, a, b) for(int i = a; i <= b; i++)
#define all(x) x.begin(), x.end()
#define trav(a, x) for(auto& a : x)
#define fill(x,y) memset(x,y,sizeof(x))
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
ll mul(ll x, ll y)
{
    return (x * 1ll * y) % MOD;
}

ll fastpow(ll x, ll y)
{
    ll z = 1;
    while(y)
    {
        if(y & 1) z = mul(z, x);
        x = mul(x, x);
        y >>= 1;
    }
    return z;
}
struct Comp {
  bool operator()(const std::pair<int, int> &a, const std::pair<int, int> &b) {
    if (a.second != b.second) {
      return a.second < b.second;
    }
    return a.first <b.first;
  }
};
int main(int argc, char** argv)
{
  sws ;
  cout<<setprecision(20);
  //tcase
  {
   ll n,m ;
   cin>>n>>m ;
   vector<ll>adj[n];
   forn(i,m)
   {
   	ll u,v ;
   	cin>>u>>v ;
   	u-- ;
   	v-- ;
   	adj[u].pb(v) ;
   	adj[v].pb(u) ;
   }
   ll a[n];
   ll b[n]={0};
   forn(i,n)
   cin>>a[i] ;
   queue<ll>q;
   vector<ll>ans ;
   forn(i,n)
   {
   	if(a[i]==0)
   	{
   		q.push(i) ;
	   }
   }
   while(!q.empty())
   {
   		if(a[q.front()]==b[q.front()])
   		{b[q.front()]++;
   		ans.pb(q.front());
   		  for(auto u:adj[q.front()])
			 {b[u]++;
			 if(b[u]==a[u])
			 q.push(u);
			 //ans.pb(u) ;
			 }
		}
		q.pop();
   }
   for(auto x:ans)
   cout<<x+1<<" ";
  }
return 0 ;
}


#include <bits/stdc++.h>
#define ff first
#define ss second
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define pii pair<int, int>
#define pll pair<long long,long long>
#define vl vector<long long>
#define vll vector<pll>
#define vi vector<int>
#define vii vector<pii>
#define sws ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define endl '\n'
#define tcase int tt; cin>>tt; while(tt--)
#define tcase2 int tt; cin>>tt; for(int qq=1;qq<=tt;qq++)
using namespace std;
typedef long long int ll;
typedef  unsigned long long int ull;
typedef long double ld;
const int MAXN = 1000002;
const int MOD2 = 998244353;
const int MOD = 1000000007;
const int INF = 1e8;
const ld EPS = 1e-7;
// Extra
#define forn(i, n) for(int i = 0; i < (int)n; i++)
#define forne(i, a, b) for(int i = a; i <= b; i++)
#define all(x) x.begin(), x.end()
#define trav(a, x) for(auto& a : x)
#define fill(x,y) memset(x,y,sizeof(x))
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
ll mul(ll x, ll y)
{
    return (x * 1ll * y) % MOD;
}

ll fastpow(ll x, ll y)
{
    ll z = 1;
    while(y)
    {
        if(y & 1) z = mul(z, x);
        x = mul(x, x);
        y >>= 1;
    }
    return z;
}
struct Comp {
  bool operator()(const std::pair<int, int> &a, const std::pair<int, int> &b) {
    if (a.second != b.second) {
      return a.second < b.second;
    }
    return a.first <b.first;
  }
};
int main(int argc, char** argv)
{
  sws ;
  cout<<setprecision(20);
  //tcase
  {
   ll n,m ;
   cin>>n>>m ;
   vector<ll>adj[n];
   forn(i,m)
   {
   	ll u,v ;
   	cin>>u>>v ;
   	u-- ;
   	v-- ;
   	adj[u].pb(v) ;
   	adj[v].pb(u) ;
   }
   ll a[n];
   ll b[n]={0};
   forn(i,n)
   cin>>a[i] ;
   queue<ll>q;
   vector<ll>ans ;
   forn(i,n)
   {
   	if(a[i]==0)
   	{
   		q.push(i) ;
	   }
   }
   while(!q.empty())
   {
   		if(a[q.front()]==b[q.front()])
   		{b[q.front()]++;
   		ans.pb(q.front());
   		  for(auto u:adj[q.front()])
			 {b[u]++;
			 if(b[u]==a[u])
			 q.push(u);
			 //ans.pb(u) ;
			 }
		}
		q.pop();
   }
   cout<<ans.size()<<"\n" ;
   for(auto x:ans)
   cout<<x+1<<" ";
  }
return 0 ;
}


#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops")
#include <bits/stdc++.h>
#define ff first
#define ss second
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define pii pair<int, int>
#define pll pair<long long,long long>
#define vl vector<long long>
#define vll vector<pll>
#define vi vector<int>
#define vii vector<pii>
#define sws ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define endl '\n'
#define tcase int tt; cin>>tt; while(tt--)
#define tcase2 int tt; cin>>tt; for(int qq=1;qq<=tt;qq++)
using namespace std;
typedef long long int ll;
typedef  unsigned long long int ull;
typedef long double ld;
const int MAXN = 1000002;
const int MOD2 = 998244353;
const int MOD = 1000000007;
const int INF = 1e8;
const ld EPS = 1e-7;
// Extra
#define forn(i, n) for(int i = 0; i < (int)n; i++)
#define forne(i, a, b) for(int i = a; i <= b; i++)
#define all(x) x.begin(), x.end()
#define trav(a, x) for(auto& a : x)
#define fill(x,y) memset(x,y,sizeof(x))
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
ll mul(ll x, ll y)
{
    return (x * 1ll * y) % MOD;
}

ll fastpow(ll x, ll y)
{
    ll z = 1;
    while(y)
    {
        if(y & 1) z = mul(z, x);
        x = mul(x, x);
        y >>= 1;
    }
    return z;
}
struct Comp {
  bool operator()(const std::pair<int, int> &a, const std::pair<int, int> &b) {
    if (a.second != b.second) {
      return a.second < b.second;
    }
    return a.first <b.first;
  }
};
int main(int argc, char** argv)
{
  sws ;
  cout<<setprecision(20);
  //tcase
  {
   ll n,m ;
   cin>>n>>m ;
   vector<ll>adj[n];
   forn(i,m)
   {
   	ll u,v ;
   	cin>>u>>v ;
   	u-- ;
   	v-- ;
   	adj[u].pb(v) ;
   	adj[v].pb(u) ;
   }
   ll a[n];
   ll b[n]={0};
   forn(i,n)
   cin>>a[i] ;
   queue<ll>q;
   vector<ll>ans ;
   forn(i,n)
   {
   	if(a[i]==0)
   	{
   		q.push(i) ;
	   }
   }
   while(!q.empty())
   {
   		if(a[q.front()]==b[q.front()])
   		{b[q.front()]++;
   		ans.pb(q.front());
   		  for(auto u:adj[q.front()])
			 {b[u]++;
			 if(b[u]==a[u])
			 q.push(u);
			 //ans.pb(u) ;
			 }
		}
		q.pop();
   }
   cout<<ans.size()<<"\n" ;
   for(auto x:ans)
   cout<<x+1<<" ";
  }
return 0 ;
}


#include <bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector<pii> vpii;
const int Max = 1e5 + 5;

int main() {
    //  ios_base::sync_with_stdio(0);
      //cin.tie(0);
      //cout.tie(0);
      //freopen("input.txt", "r", stdin);
      //freopen("output.txt", "w", stdout);
    vector<vi> G;
    int n, m, a, b;
    scanf("%d%d", &n, &m);
    G.resize(n + 1);
    for (int i = 0; i < m; i++)
    {
        scanf("%d%d", &a, &b);
        G[a].push_back(b);
        G[b].push_back(a);
    }
    queue<int> Q;
    vi ans;
    int x[Max] = {};
    for (int i = 1; i <=n; i++)
    {
        scanf("%d", &x[i]);
        if (!x[i]) {
            Q.push(i);
            ans.push_back(i);
        }

    }
   // bool visited[Max] = {};
    while (!Q.empty())
    {
        int v = Q.front();
        Q.pop();
        x[v]--;
        for (int u : G[v]) {
            x[u]--;
            if (x[u] == 0) {
                Q.push(u);
                ans.push_back(u);
            }
        }
    }
    printf("%d\n",(int)ans.size());
    for (auto it : ans) {
        printf("%d ", it);
    }

    return 0;
}


#ifndef TEMPLATE
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define int long long
#ifdef LOCAL
#include<debug.h>
#else
#define db(...) 21
#endif
#define mp make_pair
#define sz(a) ((int)(a).size())
#define mem(x,v) memset((x),(v),sizeof((x)));
#define A(x) (x).begin(),(x).end()
#define re(i,n) for(int i=0;i<(int)n;i++)
#define rep(i,k,n) for(int i=k;i<=n;i++)
#define erp(i,k,n) for(int i=n;i>=k;i--)
#define input(v,n) re(i,n)cin>>v[i]
using vi = vector<int>;
using vpi = vector<pair<int,int>>;
using vvi = vector<vi>;
using tp = tuple<int,int,int>;
using pi = pair<int,int>;

void __READ__() {
	srand(time(NULL));
	ios_base :: sync_with_stdio(false);
	cin.tie(NULL);
	#ifdef LOCAL
	freopen("input.txt","r",stdin);
	#endif
}

template<typename T>
inline istream &operator>>(istream &_in, vector<T> &_v) {
	for (auto &_i : _v) { _in >> _i; }; return _in;
}
template<typename T,typename U>
inline istream &operator>>(istream &_in, pair<T, U> &_p) {
	_in >> _p.first >> _p.second;
	return _in;
}
#endif
const int nax = 1e5+7;
const int mod = 1e9+7; //1e9+2667 :: 0xcf : inf, 0xc0 -inf
const int inf = numeric_limits<int> :: max() - (int)9e6;
// ===================== MANASH =================== //

void test() {
	int n,m; cin >> n; cin >> m;
	vvi adj(n+1);
	re(i,m) {
		int a,b; cin >> a >> b;
		adj[a].push_back(b); adj[b].push_back(a);
	}
	vi co(n+1),vu(n+1); rep(i,1,n) cin >> vu[i];
	vi q;
	rep(i,1,n) if ( co[i] == vu[i]) {
		q.push_back(i);
	}
	set<int> push;
	for( int i = 0; i < sz(q); i++) {
		int u = q[i];
		if(co[u] != vu[u]) continue;
		if(push.count(u)) continue;
		co[u]++;
		push.insert(u);
		for( int v : adj[u]) {
			co[v]++;
			if(co[v] == vu[v] and !push.count(v)) {
				q.push_back(v);
			}
		}
	}

	rep(i,1,n) if(co[i] == vu[i]) {
		cout << -1;
		return;
	}
	db(co,vu);
	cout << sz(push) << '\n'; for( int x : push ) cout << x << ' ';
}

signed main() {

	__READ__();
	int T = 1;
	//cin >> T;
	for( int tt = 1; tt <= T; tt++) {
		//cout << "Case #" << tt << " ";
		test();
		cout << "\n";
	}
	return 0;

}


//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <cmath>
#include <unordered_set>
#include <unordered_map>
#include <iomanip>
#include <deque>
#include <chrono>
#include <cassert>
#include <bitset>
#include <random>

using namespace std;

typedef long long li;
typedef  long double ld;
const li MAX = 5e5 + 20;

li inf = (li)1e9;
li mod = (li)1e9 + 7;
li n, m, a[MAX], cur[MAX];
vector<li> gr[MAX];
vector<li> ans;

void solve() {
	cin >> n >> m;
	vector<li> del;
	for (int i = 1; i <= m; i++) {
		li a, b;
		cin >> a >> b;
		gr[a].push_back(b);
		gr[b].push_back(a);
	}
	for (int i = 1; i <= n; i++) {
		cin >> a[i];
		if (a[i] == 0) del.push_back(i);
	}

	while (del.size()) {
		vector<li> use, nxt;
		use = del;
		del.clear();
		for (int i = 0; i < use.size(); i++) {
			li v = use[i];
			if (cur[v] == a[v]) {
				ans.push_back(v);
				cur[v]++;
				for (auto u : gr[v]) {
					cur[u]++;
					if (cur[u] == a[u]) nxt.push_back(u);
				}
			}
		}
		del = nxt;
	}

	cout << ans.size() << "\n";
	for (int i = 0; i < ans.size(); i++) cout << ans[i] << " ";
 }

int main() {
	mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
	ios::sync_with_stdio(0);
	li q;
	q = 1;
	while (q--) solve();

	return 0;
}


#include<bits/stdc++.h>
using namespace std;

typedef double                 ld;
typedef long long                   ll;
typedef pair<int,int>               pii;
typedef pair<ll,ll>                 pll;
typedef pair<string , string>       pss;

#define all(x)                      (x).begin(),(x).end()
#define Sort(x)                     sort(all((x)))
#define F                           first
#define S                           second
#define sep                         ' '
#define endl                        '\n'
#define file_io                     freopen("input.txt" , "r+" , stdin) ; freopen("output.txt" , "w+" , stdout);
#define fast_io                     ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define error(x)                    cerr << "$$$ " << x << '\n';
#define error2(x,y)                 cerr << "#F : " << x << "      #S : " << y << '\n';
#define kill(x)                     return cout << x << endl , 0;
#define pb                          push_back

const ll MXN = 3e3 + 10;
const ll MXM = 5e2 + 10;
const ll MX5 = 1e5 + 10;
const ll MX6 = 1e6 + 10;
const ll INF = 8e18;
const ld eps = 1e-9;
const ll MOD = 1e9 + 7; //998244353;

ll power(ll a, ll b, ll md) {
    return (!b ? 1 : (b & 1 ? a * power(a * a % md, b / 2, md) % md : power(a * a % md, b / 2, md) % md));
}
ll bmm(ll a,ll b){
    return (a%b==0 ? b : bmm(b,a%b));
}
string base2(ll n){
    string a="";while(n>=2){a+=(char)(n%2+'0');n/=2;}a+=(char)(n+'0');reverse(all(a));return a;
}

ll n, m, A[MX5], Now[MX5];
vector<ll> G[MX5], vec;
bool vis[MX5];
queue<ll> q;

int main(){
    fast_io
    //file_io
    cin >> n >> m;
    for(int i = 0; i < m; i ++){
        ll u, v;
        cin >> u >> v;
        G[u].pb(v);
        G[v].pb(u);
    }
    for(int i = 1; i <= n; i ++){
        cin >> A[i];
        if(A[i] == 0){
            q.push(i);
        }
    }

    while(!q.empty()){
        ll u = q.front();
        vec.pb(u);
        q.pop();
        vis[u] = 1;
        Now[u] ++;
        for(auto v : G[u]){
            Now[v] ++;
            if(!vis[v] && Now[v] == A[v]){
                q.push(v);
                vis[v] = 1;
            }
        }
    }

    cout << vec.size() << endl;
    for(int i = 0; i < vec.size(); i ++){
        cout << vec[i] << sep;
    }

    return 0;
}

//! N.N


///A drunk man will find his way home, but a drunk bird may get lost forever...
#include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define int long long
typedef long long ll;
typedef double dd;
typedef pair <int, int> pii;
#define pb push_back
#define pf push_front
#define ppb pop_back()
#define ppf pop_front()
#define f first
#define s second
#define sz(x) (int)x.size()
#define smin(x , y) x = min(x , y)
#define smax(x , y) x = max(x , y)
#define mp make_pair
#define all(x) x.begin() , x.end()
const int mx = 1e5 + 5;
vector < int > ad[mx], ans, ve;
int a[mx], cnt[mx];
int32_t main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
	int n, m, u, v;
	cin >> n >> m;
	for(int i = 0; i < m; i++){
		cin >> u >> v;
		u--, v--;
		ad[u].pb(v);
		ad[v].pb(u);
	}
	for(int i = 0; i < n; i++){
		cin >> a[i];
		if(!a[i])
			ve.pb(i);
	}
	while(sz(ve)){
		v = ve.back();
		ve.ppb;
		if(cnt[v] != a[v])
			continue;
		ans.pb(v);
		cnt[v]++;
		for(int u : ad[v]){
		   cnt[u]++;
		   if(cnt[u] == a[u])
			   ve.pb(u);
		}
	}
	cout << sz(ans) << endl;
	for(int u : ans)
		cout << u + 1 << " ";
	cout << endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pi 2*acos(0.0)
#define f first
#define s second
#define pb push_back
#define gap ' '
#define fastio {ios_base::sync_with_stdio(false);cin.tie(NULL);}
#define mod 1000000007
#define N 100005
vector<int> g[N];
int a[N];
int b[N];
int main()
{
    int n,m;
    cin>>n>>m;
    for(int i=0;i<m;i++)
    {
        int x,y;
        cin>>x>>y;
        g[x].pb(y);
        g[y].pb(x);
    }
    for(int i=1;i<=n;i++) cin>>a[i];
    queue<int> q;
    vector<int> ans;
    for(int i=1;i<=n;i++) if(a[i]==b[i])    q.push(i);
    while(!q.empty())
    {
        int u=q.front();
        q.pop();
        b[u]++;
        ans.pb(u);
        for(int v : g[u])
        {
            b[v]++;
            if(b[v]==a[v])  q.push(v);
        }
    }
    cout<<ans.size()<<endl;
    for(int i : ans) cout<<i<<gap;
}


#include <iostream>
#include <vector>
#include <queue>
using namespace std;
struct node{
vector<int> adj;
int counter;
int light;
};
int main()
{
    queue<int>q;
    int n,m;
    cin >> n >> m;
    struct node nodes[n];
    int suppnodes[n];
    for(int i = 0 ; i < n ;i++){
        nodes[i].counter=0;
        nodes[i].light=0;
    }
    for(int i = 0 ; i < m ;i++){
        int x,y;
        cin >>x >>y;
        x--;
        y--;
        nodes[x].adj.push_back(y);
        nodes[y].adj.push_back(x);
    }
    for(int i = 0 ; i < n ;i++){
        cin >>suppnodes[i];
    }
    int ans=0;
    vector<int>ansn;

    for(int i = 0 ; i < n;i++){
        if(suppnodes[i]==nodes[i].counter){
            q.push(i);
            while(!q.empty()){
                int v = q.front();
                q.pop();
                if(suppnodes[v]==nodes[v].counter&&nodes[v].light==0){
                    nodes[v].counter++;
                    nodes[v].light=1;
                    ans++;
                    for(int e = 0 ; e<nodes[v].adj.size();e++){
                        nodes[nodes[v].adj[e]].counter++;
                        if(nodes[nodes[v].adj[e]].counter==suppnodes[nodes[v].adj[e]]){
                            q.push(nodes[v].adj[e]);
                        }
                    }
                }else if(suppnodes[v]==nodes[v].counter){
                nodes[v].counter--;
                nodes[v].light=0;
                ans--;
                for(int e = 0 ; e<nodes[v].adj.size();e++){
                        nodes[nodes[v].adj[e]].counter--;
                        if(nodes[nodes[v].adj[e]].counter==suppnodes[nodes[v].adj[e]]){
                            q.push(nodes[v].adj[e]);
                        }
                    }
                }
            }
        }
    }
    cout << ans << endl;
    for(int i = 0 ; i < n;i++){
        if(nodes[i].light==1){
            cout << i+1 << ' ' ;
        }
    }
    return 0;
}


#include <iostream>
#include <vector>
#include <queue>
using namespace std;
struct node{
vector<int> adj;
int counter;
int light;
};
int main()
{
    queue<int>q;
    int n,m;
    cin >> n >> m;
    struct node nodes[n];
    int suppnodes[n];
    for(int i = 0 ; i < n ;i++){
        nodes[i].counter=0;
        nodes[i].light=0;
    }
    for(int i = 0 ; i < m ;i++){
        int x,y;
        cin >>x >>y;
        x--;
        y--;
        nodes[x].adj.push_back(y);
        nodes[y].adj.push_back(x);
    }
    for(int i = 0 ; i < n ;i++){
        cin >>suppnodes[i];
    }
    int ans=0;
    vector<int>ansn;
    for(int j = 0 ; j < n ;j++){
    for(int i = 0 ; i < n;i++){
        if(suppnodes[i]==nodes[i].counter){
            q.push(i);
            while(!q.empty()){
                int v = q.front();
                q.pop();
                if(suppnodes[v]==nodes[v].counter&&nodes[v].light==0){
                    nodes[v].counter++;
                    nodes[v].light=1;
                    ans++;
                    for(int e = 0 ; e<nodes[v].adj.size();e++){
                        nodes[nodes[v].adj[e]].counter++;
                        if(nodes[nodes[v].adj[e]].counter==suppnodes[nodes[v].adj[e]]){
                            q.push(nodes[v].adj[e]);
                        }
                    }
                }else if(suppnodes[v]==nodes[v].counter){
                nodes[v].counter--;
                nodes[v].light=0;
                ans--;
                for(int e = 0 ; e<nodes[v].adj.size();e++){
                        nodes[nodes[v].adj[e]].counter--;
                        if(nodes[nodes[v].adj[e]].counter==suppnodes[nodes[v].adj[e]]){
                            q.push(nodes[v].adj[e]);
                        }
                    }
                }
            }
        }
    }}
    cout << ans << endl;
    for(int i = 0 ; i < n;i++){
        if(nodes[i].light==1){
            cout << i+1 << ' ' ;
        }
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
using ll = long long;

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0), cout.tie(0);
	int n, m;
	cin >> n >> m;
	vector<vector<int>> g(n);
	for (int i = 0; i < m; i++) {
		int v, u;
		cin >> v >> u;
		v--, u--;
		g[v].push_back(u);
		g[u].push_back(v);
	}
	vector<int> a(n);
	queue<int> q;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
		if (!a[i]) q.push(i);
	}
	vector<int> val(n, 0), ans;
	while (q.size()) {
		int v = q.front();
		q.pop();
		if (val[v] != a[v]) continue;
		ans.push_back(v);
		val[v]++;
		for (auto u : g[v]) {
			val[u]++;
			if (val[u] == a[u]) q.push(u);
		}
	}
	cout << ans.size() << '\n';
	for (auto &el : ans) cout << el + 1 << ' ';
}


#include <bits/stdc++.h>

#define INF 1e9
#define EPS 1e-6
#define pb push_back
#define pause system("pause");
#define exit exit(0)

using namespace std;
using ll = long long;
using ull = unsigned long long;

int n, m, ptr = 0;
vector<int> g[100005];
int a[100005], b[100005];
int r[200005];
queue<int> q;

void press(int u) {
	r[ptr++] = u;

	++b[u];
	if (a[u] == b[u]) {
		q.push(u);
	}

	for (auto v : g[u]) {
		++b[v];
		if (a[v] == b[v]) {
			q.push(v);
		}
	}
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0), cout.tie(0);

	cin >> n >> m;
	for (int i = 0, u, v; i < m; ++i) {
		cin >> u >> v;
		g[u].pb(v), g[v].pb(u);
	}

	for (int i = 1; i <= n; ++i) {
		cin >> a[i];
		if (a[i] == b[i]) {
			q.push(i);
		}
	}

	while (!q.empty()) {
		int t = q.front();
		q.pop();

		if (a[t] != b[t]) {
			continue;
		}

		press(t);
	}

	cout << ptr << endl;
	for (int i = 0; i < ptr; ++i) {
		cout << r[i] << ' ';
	}
	cout << endl;
	//pause;
	return 0;
}


#include<bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
//using NAMspace __gnu_pbds;
//typedef tree<LL, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;
#define ll                  long long
#define ull                 unsigned long long
#define scl(n)              scanf("%lld", &n)
#define scll(n,m)           scanf("%lld %lld",&n,&m)
#define sclll(n,m,p)        scanf("%lld %lld %lld",&n,&m,&p)
#define scf(n)              scanf("%lf", &n)
#define sci(n)              scanf("%d", &n)
#define scii(n,m)           scanf("%d %d",&n,&m)
#define sciii(n,m,p)        scanf("%d %d %d",&n,&m,&p)
#define scs(n)              scanf("%s", n)
#define pfi(n)              printf("%d\n",n)
#define pfl(n)              printf("%lld\n",n)
#define pfs(s)              printf("%s\n",s)
#define dist2D(x1,y1,x2,y2)         ((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2))
#define dist3D(x1,y1,z1,x2,y2,z2)   ((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)+(z1-z2)*(z1-z2))
#define bug1(x)                cerr<<#x<<": "<<x<<endl
#define bug2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define bug3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define bug4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define bug5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
#define bug6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl

#define FASTREAD            ios_base::sync_with_stdio(0);cin.tie(nullptr);
#define MOD                 1000000007
#define MODP                99999999999973LL
#define pb                  push_back
#define pi                  pair<ll,ll>
#define pii                 pair<pi,ll>
#define mp                  make_pair
#define memo(a,b)           memset(a,b,sizeof(a))
#define INF                 1e18
#define EPS                 1e-13
#define Pi                  acos(-1)
//ll Set(ll mask,ll pos){return mask=mask | (1LL<<pos);}
//ll reset(ll mask,ll pos){return mask= mask & ~(1LL<<pos);}
//bool check(ll mask,ll pos){return (bool)(mask & (1LL<<pos));}
//ll bigmod(ll b, ll p, ll md){if(p==0) return 1;if(p%2==1){ return ((b%md)*bigmod(b,p-1,md))%md;} else {ll y=bigmod(b,p/2,md);return (y*y)%md;}}
#define N 1000006

ll arr[N];
ll now[N];
vector<ll>g[N];

int main(){

    ll n,m;
    cin>>n>>m;
    for(ll i=0;i<m;i++){
            ll a,b;
            cin>>a>>b;
            g[a].pb(b);
            g[b].pb(a);
    }
    queue<ll>q;
    for(ll i=1;i<=n;i++){
            cin>>arr[i];
            if(arr[i]==0) q.push(i);
    }
    vector<ll>ans;
    while(q.size()){
            ll here=q.front();
            q.pop();
            if(now[here]==arr[here]){
                    ans.pb(here);
                    now[here]++;
                    for(ll it:g[here]){
                            now[it]++;
                            if(now[it]==arr[it]) q.push(it);
                    }
            }
    }
    cout<<ans.size()<<endl;
    for(ll it:ans) cout<<it<<' ';
    cout<<endl;

  return 0;
}

 //ll dx[] = {1,-1,0,0} , dy[] = {0,0,1,-1};  // 4 Direction
 //ll dx[] = {1,-1,0,0,1,1,-1,-1} , dy[] = {0,0,1,-1,1,-1,1,-1}; // 8 Direction
 //ll dx[] = {1,-1,1,-1,2,2,-2,-2} , dy[] = {2,2,-2,-2,1,-1,1,-1}; // Knight Direction
 //ll dx[] = {2,-2,1,1,-1,-1} , dy[] = {0,0,1,-1,1,-1}; // Hexagonal Direction


#pragma GCC optimize("Ofast")

#include <bits/stdc++.h>
using namespace std;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define pop_b pop_back
#define pf push_front
#define pop_f pop_front
#define mt make_tuple
#define eb emplace_back
#define sf(x) sizeof(x)
#define len(x) x.length()
#define sz(x) x.size()
#define fastio() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)

#define LB(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define UB(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
typedef long long ll;
typedef pair<ll,ll> ii;
typedef long double ld;
typedef vector<int> vi;
typedef vector<set<ll>> vset;
typedef vector<ll> vl;
typedef vector<ld> vd;
typedef deque<ll> dql;
typedef deque<int> dqi;
typedef unsigned long long ull;
typedef tuple<int,int,int> State;

#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
	cerr << *it << " = " << a << endl;
	err(++it, args...);
}
template<class T, class U> inline void checkmin(T &x, U y) { if (y < x) x = y; }

template<class T, class U> inline void checkmax(T &x, U y) { if (y > x) x = y; }

template<class T, class U> inline bool ifmax(T &x, U y) { if (y > x) return x = y, true; return false; }

template<class T, class U> inline bool ifmin(T &x, U y) { if (y < x) return x = y, true; return false; }

#define vmax(type)   std::numeric_limits<type>::max()
#define vmin(type)   std::numeric_limits<type>::min()
#define each(a,x) for( auto &a:(x))
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define repr(i, n) for (ll i = (n) - 1; i >= 0; i--)
#define rep2(i, l, r) for (ll i = (l); i < (r); i++)
#define rep2r(i, l, r) for (ll i = (r) - 1; i >= (l); i--)
#define range(a) a.begin(), a.end()
#define deb(x) cout<<#x<<" "<<x<<endl;
#define cini(i) int i; cin>>i;
#define cinll(l) ll l; cin>>l;
#define cinll2(l, z) ll l, z; cin>>l>>z;
#define cinll3(l, z, x) ll l, z, x; cin>>l>>z>>x;
#define cinai(a, n) vi a(n); rep(i, n) { cin>>a[i]; }
#define cinal(a, n) vl a(n); rep(i, n) { cin>>a[i]; }
#define coutai(a, n) rep(i, n) { cout<<a[i]<<" "; } ent;
#define coutal(a, n) rep(i, n) { cout<<a[i]<<" "; } ent;
#define ent cout<<endl;
#define resize_vec(a) a.resize(unique(a.begin(), a.end()) - a.begin());
#define ms(dp, x) memset(dp, x, sf(dp))

// const long long MAX_SIZE = 1000000;
// vector<long long >isprime(MAX_SIZE , true);
// vector<long long >prime;
// vector<long long >SPF(MAX_SIZE);

// // function generate all prime number less then N in O(n)
// void manipulated_seive(ll N)
// {
//     isprime[0] = isprime[1] = false ;
//     for (ll i=2; i<N ; i++)
//     {
//         if (isprime[i])
//         {
//             prime.push_back(i);
//             SPF[i] = i;
//         }
//         for (ll j=0;j < prime.size() && i*prime[j] < N && prime[j] <= SPF[i];j++)
//         {
//             isprime[i*prime[j]]=false;
//             SPF[i*prime[j]] = prime[j] ;
//         }
//     }
// }
ll fstpow(ll a, ll b) {
	ll res=1;
	while(b) {
		if(b&1)
			res=(res*a);
		a=(a*a);
		b>>=1;
	}
	return res;
}

ll powm(ll a, ll b, ll mod) {
	ll res=1;
	while(b) {
		if(b&1)
			res=(res*a)%mod;
		a=(a*a)%mod;
		b>>=1;
	}
	return res;
}
bool sortinrev(const pair<int,int> &a, const pair<int,int> &b)
{
       return (a.first > b.first);
}

void fukof()
{

}

void problem()
{

}

const ll mod = 1e9 + 7;
const ll N = 100005;
const ll inf = 1e9;

void solve()
{
	int n, m;
	cin>>n>>m;
	vl adj[n];
	while(m--)
	{
		int x, y;
		cin>>x>>y;
		x--, y--;
		adj[x].pb(y);
		adj[y].pb(x);
	}
	cinai(a, n);
	set<int> s;
	rep(i, n)
		if(a[i] == 0){
			s.insert(i);
		}
	int b[n] = {0};
	vi ans;
	while(!s.empty())
	{
		auto curr = s.begin();
		s.erase(curr);
		int x = *curr;
			// error(x);
		b[x]++;
		ans.pb(x+1);
		rep(i, adj[x].size())
		{
			b[adj[x][i]]++;
			if(b[adj[x][i]] == a[adj[x][i]])
				s.insert(adj[x][i]);
			else if(s.find(adj[x][i]) != s.end())
				s.erase(s.find(adj[x][i]));
		}
	}
	cout<<ans.size()<<endl;
	coutai(ans, ans.size());
}

// #define _DEBUG
// #define testCases
signed main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0), cout.tie(0);
	cout << fixed << setprecision(15);

	int tc = 1;
#ifdef testCases
	cin>>tc;
#endif
	while(tc--)
	{
#ifdef _DEBUG
	int tt = clock();
#endif
		problem();
		fukof();
		solve();

#ifdef _DEBUG
		cerr << "TIME = " << clock() - tt << endl;
		tt = clock();
#endif
	}
	return 0;
}


#pragma optimization_level 3
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
#include <bits/stdc++.h>
#define  f               first
#define  s               second
#define  sym(s)          s = "#" + s + "#";
#define  all(x)          (x).begin(), (x).end()
#define  alll(x,n)       x+1, x+n+1
#define  newl            cout<<"\n";
#define  foo(i,a,n)      for(ll i = (a); i <= n; i++)
#define  deb1(a)         cout<<a<<"\n";
#define  deb2(a,b)       cout<<a<<" "<<b<<"\n";
#define  deb3(a,b,c)     cout<<a<<" "<<b<<" "<<c<<"\n";
#define  deb4(a,b,c,d)   cout<<a<<" "<<b<<" "<<c<<" "<<d<<"\n";
#define  debp(a)         cout<<a.f<<" "<<a.s<<"\n";
#define  debv(a)         for(auto it: a)cout<<it<<" ";newl;
#define  debm(a)         for(auto it: a)cout<<"{"<<it.f<<","<<it.s<<"}, ";newl;
#define  deb1d(a,n)      foo(i,1,n)cout<<a[i]<<" ";newl;
#define  deb2d(a,n,m)    foo(i,1,n){foo(j,1,m){cout<<a[i][j]<<" ";}newl;}

using namespace std;
using ll              =  long long;
using ld              =  long double;
const ll   MOD        =  1e+9 + 7;
const ll   INF        =  LLONG_MAX;
const int  N          =  (int)2e+5 + 8;

ll n, m, u, v, a[N], b[N];
vector<ll> adj[N];

void MAIN(int tc){
    cin >> n >> m;
    for(int i = 1; i <= m; i++){
        cin >> u >> v;
        adj[u].push_back(v);
        adj[v].push_back(u);
    }
    queue<ll> q;
    vector<ll> res;
    for(int i = 1; i <= n; i++){
        cin >> a[i];
        if(a[i] == 0) q.push(i);
    }
    while(q.size()){
        ll v = q.front(); q.pop();
        if(b[v] == a[v]){
            res.push_back(v);
            for(auto to: adj[v]){
                b[to] += 1;
                if(b[to] == a[to]){
                    q.push(to);
                }
            }
        }
    }
    deb1(res.size());
    debv(res);
}

int main(){
    ios:: sync_with_stdio(false);
    cin.tie(nullptr); cout.tie(nullptr);
    cout<<fixed; cout<<setprecision(10);

    int test_cases = 1;
    //cin>>test_cases;
    for(int i = 1; i <= test_cases; i++){
        MAIN(i);
    }
}


#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;

#define fi              first
#define se              second
#define ll              long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
#define FIO             ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
mt19937                 rng(chrono::steady_clock::now().time_since_epoch().count());

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;

const int N=2e5+5;

int main()
{
	 FIO;

	 ll n,m;
	 cin>>n>>m;

	 vector<ll> g[100050];

	 for(ll i=0;i<m;i++)
	 {
		 ll u,v;
		 cin>>u>>v;
		 g[u].pb(v);
		 g[v].pb(u);
	 }
	  queue<ll> q;
	 vector<ll> val(n+1),cnt(n+1,0);
	 for(ll i=1;i<=n;i++)
	 {
		 cin >>val[i];

		 if(val[i]==0)
			q.push(i);
	 }
	 vector<ll> ans;

	 while(!q.empty())
	 {

			ll node=q.front();
			q.pop();
			if(cnt[node]!=val[node])
			{
				continue;
			}
			ans.pb(node);
			cnt[node]++;

			for(auto i:g[node])
			{
				cnt[i]++;
				if(cnt[i]==val[i])
					q.push(i);
			}

	 }

	 cout<<ans.size()<<endl;
	 for(auto i:ans)
	 {
		 cout<<i<<" ";
	 }

}


#include <bits/stdc++.h>
#pragma GCC optimize ("Ofast")
using namespace std;

// #define int long long
#define sync ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define file freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout)
#define endl "\n"
#define ends " "
#define die(x) return cout << x << endl, 0
#define all(v) v.begin(), v.end()
#define debug(x) cerr << #x << ": " << x << endl
#define debugP(p) cerr << #p << ": {" << p.first << ", " << p.second << '}' << endl
#define debugV(v) cerr << #v << ": [ "; for(int __ = 0; __ < v.size(); __++) cerr << v[__] << ((__ != v.size() - 1) ? ", " : ends); cerr << ']' << endl
#define debugVP(v) cerr << #v << ": [ "; for(int ___ = 0; ___ < v.size(); ___++) cerr << '{' << v[___].first << ", " << v[___].second << '}' << ((___ != v.size() - 1) ? ", " : ends); cerr << ']' << endl
#define debugA(a, n) cerr << #a << ": [ "; for(int ____ = 0; ____ < n; ____++) cerr << a[____] << ((____ != n - 1) ? ", " : ends); cerr << ']' << endl
#define print(args...) fprintf (st                                  derr, args)
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector<pii> vpii;
typedef map<pii, int> mpii;
typedef set<int> sti;
const int INF = 1e9, MOD = /* INF + 7 */ INF - 1755647;
int gcd(int a, int b) { return (b ? gcd(b, a % b) : a); }
int power(int a, int b) { return (!b ? 1 : power(a, b / 2) * power(a, b / 2) * (b % 2 ? a : 1)); }
int mod(int a) { return (a % MOD + MOD) % MOD; }

/////////////////////////////////////////////////////////////////////

const int N = 2e5 + 20;

struct node {
    int val = 0;
    vi adj;
};

int a[N];
node g[N];
vi ans;

void run(int v) {
    for(int u : g[v].adj) g[u].val++;
    ans.push_back(v);
}

int32_t main(){

    sync;

    int n, m; cin >> n >> m;
    for(int i = 0; i < m; i++) {
        int v, u; cin >> v >> u;
        g[v].adj.push_back(u);
        g[u].adj.push_back(v);
    }
    for(int i = 1; i <= n; i++) cin >> a[i];

    for(int i = 1; i <= n; i++) if (g[i].val == a[i]) run(i);

    cout << ans.size() << endl;
    for(int v : ans) cout << v << ends;
    cout << endl;

    return 0;
}


#include <bits/stdc++.h>
#pragma GCC optimize ("Ofast")
using namespace std;

// #define int long long
#define sync ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define file freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout)
#define endl "\n"
#define ends " "
#define die(x) return cout << x << endl, 0
#define all(v) v.begin(), v.end()
#define debug(x) cerr << #x << ": " << x << endl
#define debugP(p) cerr << #p << ": {" << p.first << ", " << p.second << '}' << endl
#define debugV(v) cerr << #v << ": [ "; for(int __ = 0; __ < v.size(); __++) cerr << v[__] << ((__ != v.size() - 1) ? ", " : ends); cerr << ']' << endl
#define debugVP(v) cerr << #v << ": [ "; for(int ___ = 0; ___ < v.size(); ___++) cerr << '{' << v[___].first << ", " << v[___].second << '}' << ((___ != v.size() - 1) ? ", " : ends); cerr << ']' << endl
#define debugA(a, n) cerr << #a << ": [ "; for(int ____ = 0; ____ < n; ____++) cerr << a[____] << ((____ != n - 1) ? ", " : ends); cerr << ']' << endl
#define print(args...) fprintf (st                                  derr, args)
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector<pii> vpii;
typedef map<pii, int> mpii;
typedef set<int> sti;
const int INF = 1e9, MOD = /* INF + 7 */ INF - 1755647;
int gcd(int a, int b) { return (b ? gcd(b, a % b) : a); }
int power(int a, int b) { return (!b ? 1 : power(a, b / 2) * power(a, b / 2) * (b % 2 ? a : 1)); }
int mod(int a) { return (a % MOD + MOD) % MOD; }

/////////////////////////////////////////////////////////////////////

const int N = 2e5 + 20;

struct node {
    int val = 0;
    bool marked = false;
    vi adj;
};

int a[N];
node g[N];
set<int> ans;

void run(int src) {
    g[src].marked = true;
    queue<int> q;
    q.push(src);
    while(!q.empty()) {
        int v = q.front(); q.pop();
        ans.insert(v);
        for(int u : g[v].adj) {
            g[u].val++;
            if (g[u].val == a[u]) q.push(u);
        }
    }
}

int32_t main(){

    sync;

    int n, m; cin >> n >> m;
    for(int i = 0; i < m; i++) {
        int v, u; cin >> v >> u;
        g[v].adj.push_back(u);
        g[u].adj.push_back(v);
    }
    for(int i = 1; i <= n; i++) cin >> a[i];

    for(int i = 1; i <= n; i++) if (g[i].val == a[i]) run(i);

    cout << ans.size() << endl;
    for(int v : ans) cout << v << ends;
    cout << endl;

    return 0;
}


#include <bits/stdc++.h>
#pragma GCC optimize ("Ofast")
using namespace std;

// #define int long long
#define sync ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define file freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout)
#define endl "\n"
#define ends " "
#define die(x) return cout << x << endl, 0
#define all(v) v.begin(), v.end()
#define debug(x) cerr << #x << ": " << x << endl
#define debugP(p) cerr << #p << ": {" << p.first << ", " << p.second << '}' << endl
#define debugV(v) cerr << #v << ": [ "; for(int __ = 0; __ < v.size(); __++) cerr << v[__] << ((__ != v.size() - 1) ? ", " : ends); cerr << ']' << endl
#define debugVP(v) cerr << #v << ": [ "; for(int ___ = 0; ___ < v.size(); ___++) cerr << '{' << v[___].first << ", " << v[___].second << '}' << ((___ != v.size() - 1) ? ", " : ends); cerr << ']' << endl
#define debugA(a, n) cerr << #a << ": [ "; for(int ____ = 0; ____ < n; ____++) cerr << a[____] << ((____ != n - 1) ? ", " : ends); cerr << ']' << endl
#define print(args...) fprintf (st                                  derr, args)
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector<pii> vpii;
typedef map<pii, int> mpii;
typedef set<int> sti;
const int INF = 1e9, MOD = /* INF + 7 */ INF - 1755647;
int gcd(int a, int b) { return (b ? gcd(b, a % b) : a); }
int power(int a, int b) { return (!b ? 1 : power(a, b / 2) * power(a, b / 2) * (b % 2 ? a : 1)); }
int mod(int a) { return (a % MOD + MOD) % MOD; }

/////////////////////////////////////////////////////////////////////

const int N = 2e5 + 20;

struct node {
    int val = 0;
    bool marked = false;
    vi adj;
};

int a[N];
node g[N];
vi ans;

void run(int src) {
    g[src].marked = true;
    queue<int> q;
    q.push(src);
    while(!q.empty()) {
        int v = q.front(); q.pop();
        ans.push_back(v);
        for(int u : g[v].adj) {
            g[u].val++;
            if (g[u].val == a[u]) q.push(u);
        }
    }
}

int32_t main(){

    sync;

    int n, m; cin >> n >> m;
    for(int i = 0; i < m; i++) {
        int v, u; cin >> v >> u;
        g[v].adj.push_back(u);
        g[u].adj.push_back(v);
    }
    for(int i = 1; i <= n; i++) cin >> a[i];

    for(int i = 1; i <= n; i++) if (g[i].val == a[i]) run(i);

    cout << ans.size() << endl;
    for(int v : ans) cout << v << ends;
    cout << endl;

    return 0;
}


#include <bits/stdc++.h>
#pragma GCC optimize ("Ofast")
using namespace std;

// #define int long long
#define sync ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define file freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout)
#define endl "\n"
#define ends " "
#define die(x) return cout << x << endl, 0
#define all(v) v.begin(), v.end()
#define debug(x) cerr << #x << ": " << x << endl
#define debugP(p) cerr << #p << ": {" << p.first << ", " << p.second << '}' << endl
#define debugV(v) cerr << #v << ": [ "; for(int __ = 0; __ < v.size(); __++) cerr << v[__] << ((__ != v.size() - 1) ? ", " : ends); cerr << ']' << endl
#define debugVP(v) cerr << #v << ": [ "; for(int ___ = 0; ___ < v.size(); ___++) cerr << '{' << v[___].first << ", " << v[___].second << '}' << ((___ != v.size() - 1) ? ", " : ends); cerr << ']' << endl
#define debugA(a, n) cerr << #a << ": [ "; for(int ____ = 0; ____ < n; ____++) cerr << a[____] << ((____ != n - 1) ? ", " : ends); cerr << ']' << endl
#define print(args...) fprintf (st                                  derr, args)
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector<pii> vpii;
typedef map<pii, int> mpii;
typedef set<int> sti;
const int INF = 1e9, MOD = /* INF + 7 */ INF - 1755647;
int gcd(int a, int b) { return (b ? gcd(b, a % b) : a); }
int power(int a, int b) { return (!b ? 1 : power(a, b / 2) * power(a, b / 2) * (b % 2 ? a : 1)); }
int mod(int a) { return (a % MOD + MOD) % MOD; }

/////////////////////////////////////////////////////////////////////

const int N = 2e5 + 20;

struct node {
    int val = 0;
    bool marked = false;
    vi adj;
};

int a[N];
node g[N];
set<int> ans;

void run(int src) {
    g[src].marked = true;
    queue<int> q;
    q.push(src);
    while(!q.empty()) {
        int v = q.front(); q.pop();
        g[v].val++;
        ans.insert(v);
        for(int u : g[v].adj) {
            g[u].val++;
            if (!g[u].marked && g[u].val == a[u]) q.push(u);
        }
    }
}

int32_t main(){

    sync;

    int n, m; cin >> n >> m;
    for(int i = 0; i < m; i++) {
        int v, u; cin >> v >> u;
        g[v].adj.push_back(u);
        g[u].adj.push_back(v);
    }
    for(int i = 1; i <= n; i++) cin >> a[i];

    for(int i = 1; i <= n; i++) if (g[i].val == a[i]) run(i);

    cout << ans.size() << endl;
    for(int v : ans) cout << v << ends;
    cout << endl;

    return 0;
}


#include <bits/stdc++.h>
#pragma GCC optimize ("Ofast")
using namespace std;

// #define int long long
#define sync ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define file freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout)
#define endl "\n"
#define ends " "
#define die(x) return cout << x << endl, 0
#define all(v) v.begin(), v.end()
#define debug(x) cerr << #x << ": " << x << endl
#define debugP(p) cerr << #p << ": {" << p.first << ", " << p.second << '}' << endl
#define debugV(v) cerr << #v << ": [ "; for(int __ = 0; __ < v.size(); __++) cerr << v[__] << ((__ != v.size() - 1) ? ", " : ends); cerr << ']' << endl
#define debugVP(v) cerr << #v << ": [ "; for(int ___ = 0; ___ < v.size(); ___++) cerr << '{' << v[___].first << ", " << v[___].second << '}' << ((___ != v.size() - 1) ? ", " : ends); cerr << ']' << endl
#define debugA(a, n) cerr << #a << ": [ "; for(int ____ = 0; ____ < n; ____++) cerr << a[____] << ((____ != n - 1) ? ", " : ends); cerr << ']' << endl
#define print(args...) fprintf (st                                  derr, args)
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector<pii> vpii;
typedef map<pii, int> mpii;
typedef set<int> sti;
const int INF = 1e9, MOD = /* INF + 7 */ INF - 1755647;
int gcd(int a, int b) { return (b ? gcd(b, a % b) : a); }
int power(int a, int b) { return (!b ? 1 : power(a, b / 2) * power(a, b / 2) * (b % 2 ? a : 1)); }
int mod(int a) { return (a % MOD + MOD) % MOD; }

/////////////////////////////////////////////////////////////////////

const int N = 2e5 + 20;

struct node {
    int val = 0;
    bool marked = false;
    vi adj;
};

int a[N];
node g[N];
vi ans;

void run(int src) {
    //g[src].marked = true;
    queue<int> q;
    q.push(src);
    while(!q.empty()) {
        int v = q.front(); q.pop();
        g[v].val++;
        ans.push_back(v);
        for(int u : g[v].adj) {
            g[u].val++;
            if (/*!g[u].marked && */g[u].val == a[u]) q.push(u);
        }
    }
}

int32_t main(){

    sync;

    int n, m; cin >> n >> m;
    for(int i = 0; i < m; i++) {
        int v, u; cin >> v >> u;
        g[v].adj.push_back(u);
        g[u].adj.push_back(v);
    }
    for(int i = 1; i <= n; i++) cin >> a[i];

    for(int i = 1; i <= n; i++) if (g[i].val == a[i]) run(i);

    cout << ans.size() << endl;
    for(int v : ans) cout << v << ends;
    cout << endl;

    return 0;
}


#include <bits/stdc++.h>
#pragma GCC optimize ("Ofast")
using namespace std;

// #define int long long
#define sync ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define file freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout)
#define endl "\n"
#define ends " "
#define die(x) return cout << x << endl, 0
#define all(v) v.begin(), v.end()
#define debug(x) cerr << #x << ": " << x << endl
#define debugP(p) cerr << #p << ": {" << p.first << ", " << p.second << '}' << endl
#define debugV(v) cerr << #v << ": [ "; for(int __ = 0; __ < v.size(); __++) cerr << v[__] << ((__ != v.size() - 1) ? ", " : ends); cerr << ']' << endl
#define debugVP(v) cerr << #v << ": [ "; for(int ___ = 0; ___ < v.size(); ___++) cerr << '{' << v[___].first << ", " << v[___].second << '}' << ((___ != v.size() - 1) ? ", " : ends); cerr << ']' << endl
#define debugA(a, n) cerr << #a << ": [ "; for(int ____ = 0; ____ < n; ____++) cerr << a[____] << ((____ != n - 1) ? ", " : ends); cerr << ']' << endl
#define print(args...) fprintf (st                                  derr, args)
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector<pii> vpii;
typedef map<pii, int> mpii;
typedef set<int> sti;
const int INF = 1e9, MOD = /* INF + 7 */ INF - 1755647;
int gcd(int a, int b) { return (b ? gcd(b, a % b) : a); }
int power(int a, int b) { return (!b ? 1 : power(a, b / 2) * power(a, b / 2) * (b % 2 ? a : 1)); }
int mod(int a) { return (a % MOD + MOD) % MOD; }

/////////////////////////////////////////////////////////////////////

const int N = 2e5 + 20;

struct node {
    int val = 0;
    bool marked = false;
    vi adj;
};

int a[N];
node g[N];
vi ans;

void run(int src) {
    g[src].marked = true;
    queue<int> q;
    q.push(src);
    while(!q.empty()) {
        int v = q.front(); q.pop();
        g[v].val++;
        ans.push_back(v);
        for(int u : g[v].adj) {
            g[u].val++;
            if (!g[u].marked && g[u].val == a[u]) q.push(u);
        }
    }
}

int32_t main(){

    sync;

    int n, m; cin >> n >> m;
    for(int i = 0; i < m; i++) {
        int v, u; cin >> v >> u;
        g[v].adj.push_back(u);
        g[u].adj.push_back(v);
    }
    for(int i = 1; i <= n; i++) cin >> a[i];

    for(int i = 1; i <= n; i++) if (g[i].val == a[i]) run(i);

    cout << ans.size() << endl;
    for(int v : ans) cout << v << ends;
    cout << endl;

    return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define F first
#define S second
#define ins insert
#define mp make_pair
#define fo(i, n1, n, x) for(int i = n1; i <= n; i += x)
#define foo(i, n, n1, x) for(int i = n; i >= n1; i -= x)
#define bit __builtin_popcount
#define md (l + ((r - l) / 2))
#define all(x) x.begin(),x.end()
#define ll long long
#define ld long double
#define eb emplace_back
#define ub upper_bound
#define lb lower_bound
#define ios ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define file(s) if (fopen(s".in", "r")) freopen(s".in", "r", stdin), freopen(s".out", "w", stdout)

using namespace std;

const int N = 1e5 + 11, mod = 1e9 + 7;
const int INF1 = 2e9 + 11;
const ll INF2 = 2e18 + 11;
const int base = 500;
const int P = 31;
const int dx[] = {1, -1, 0, 0, 1, 1, -1, -1};
const int dy[] = {0, 0, 1, -1, 1, -1, 1, -1};
const double EPS = 1e-12;
const double PI = acos(-1.0);

int n, m, a[N], ct[N];
queue < int > q;
vector < int > g[N];
main() {
    file("queue");
    ios;
    cin >> n >> m;
    fo(i, 1, m, 1) {
        int u, v;
        cin >> u >> v;
        g[u].eb(v);
        g[v].eb(u);
    }
    fo(i, 1, n, 1) {
        cin >> a[i];
        if (!a[i]) q.push(i);
    }
    vector < int > ans;
    while (!q.empty()) {
        int v = q.front();
        q.pop();
        if (ct[v] != a[v]) continue;
        ans.eb(v);
        ++ct[v];
        for (auto & to : g[v]) {
            ++ct[to];
            if (ct[to] == a[to]) q.push(to);
        }
    }
    cout << ans.size() << "\n";
    for (auto & it : ans) cout << it << " ";
    return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define F first
#define S second
#define ins insert
#define mp make_pair
#define fo(i, n1, n, x) for(int i = n1; i <= n; i += x)
#define foo(i, n, n1, x) for(int i = n; i >= n1; i -= x)
#define bit __builtin_popcount
#define md (l + ((r - l) / 2))
#define all(x) x.begin(),x.end()
#define ll long long
#define ld long double
#define eb emplace_back
#define ub upper_bound
#define lb lower_bound
#define ios ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define file(s) if (fopen(s".in", "r")) freopen(s".in", "r", stdin), freopen(s".out", "w", stdout)

using namespace std;

const int N = 1e5 + 11, mod = 1e9 + 7;
const int INF1 = 2e9 + 11;
const ll INF2 = 2e18 + 11;
const int base = 500;
const int P = 31;
const int dx[] = {1, -1, 0, 0, 1, 1, -1, -1};
const int dy[] = {0, 0, 1, -1, 1, -1, 1, -1};
const double EPS = 1e-12;
const double PI = acos(-1.0);

int n, m, a[N], ct[N];
bool us[N];
vector < int > g[N];
inline void dfs(int v) {
    us[v] = 1;
    ++ct[v];
    for (auto & to : g[v]) {
        if (!us[to]) dfs(to);
    }
}
main() {
    file("queue");
    ios;
    cin >> n >> m;
    fo(i, 1, m, 1) {
        int u, v;
        cin >> u >> v;
        g[u].eb(v);
        g[v].eb(u);
    }
    fo(i, 1, n, 1) cin >> a[i];
    vector < int > ans;
    fo(j, 1, 2, 1)
    fo(i, 1, n, 1) {
        if (a[i] == ct[i]) {
            ans.eb(i);
            dfs(i);
        }
    }
    fo(i, 1, n, 1) if (a[i] == ct[i]) return !(cout << -1);
    cout << ans.size() << "\n";
    for (auto & it : ans) cout << it << " ";
    return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define F first
#define S second
#define ins insert
#define mp make_pair
#define fo(i, n1, n, x) for(int i = n1; i <= n; i += x)
#define foo(i, n, n1, x) for(int i = n; i >= n1; i -= x)
#define bit __builtin_popcount
#define md (l + ((r - l) / 2))
#define all(x) x.begin(),x.end()
#define ll long long
#define ld long double
#define eb emplace_back
#define ub upper_bound
#define lb lower_bound
#define ios ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define file(s) if (fopen(s".in", "r")) freopen(s".in", "r", stdin), freopen(s".out", "w", stdout)

using namespace std;

const int N = 1e5 + 11, mod = 1e9 + 7;
const int INF1 = 2e9 + 11;
const ll INF2 = 2e18 + 11;
const int base = 500;
const int P = 31;
const int dx[] = {1, -1, 0, 0, 1, 1, -1, -1};
const int dy[] = {0, 0, 1, -1, 1, -1, 1, -1};
const double EPS = 1e-12;
const double PI = acos(-1.0);

int n, m, a[N], ct[N];
bool us[N];
queue < int > q;
vector < int > g[N];
inline void dfs(int v) {
    us[v] = 1;
    ++ct[v];
    for (auto & to : g[v]) if (!us[to]) dfs(to);
}
main() {
    file("queue");
    ios;
    cin >> n >> m;
    fo(i, 1, m, 1) {
        int u, v;
        cin >> u >> v;
        g[u].eb(v);
        g[v].eb(u);
    }
    fo(i, 1, n, 1) {
        cin >> a[i];
        if (!a[i]) q.push(i);
    }
    vector < int > ans;
    while (!q.empty()) {
        int v = q.front();
        q.pop();
        ans.eb(v);
        dfs(v);
    }
    cout << ans.size() << "\n";
    for (auto & it : ans) cout << it << " ";
    return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define F first
#define S second
#define ins insert
#define mp make_pair
#define fo(i, n1, n, x) for(int i = n1; i <= n; i += x)
#define foo(i, n, n1, x) for(int i = n; i >= n1; i -= x)
#define bit __builtin_popcount
#define md (l + ((r - l) / 2))
#define all(x) x.begin(),x.end()
#define ll long long
#define ld long double
#define eb emplace_back
#define ub upper_bound
#define lb lower_bound
#define ios ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define file(s) if (fopen(s".in", "r")) freopen(s".in", "r", stdin), freopen(s".out", "w", stdout)

using namespace std;

const int N = 1e5 + 11, mod = 1e9 + 7;
const int INF1 = 2e9 + 11;
const ll INF2 = 2e18 + 11;
const int base = 500;
const int P = 31;
const int dx[] = {1, -1, 0, 0, 1, 1, -1, -1};
const int dy[] = {0, 0, 1, -1, 1, -1, 1, -1};
const double EPS = 1e-12;
const double PI = acos(-1.0);

int n, m, a[N], timer, tin[N], tout[N], dp[N];
bool us[N];
vector < int > g[N];
set < pair < int, int > > st;
inline void dfs(int v) {
    tin[v] = ++timer;
    st.ins({timer, v});
    us[v] = 1;
    for (auto & to : g[v]) if (!us[to]) dfs(to);
    tout[v] = timer;
}
main() {
    file("queue");
    ios;
    cin >> n >> m;
    fo(i, 1, m, 1) {
        int u, v;
        cin >> u >> v;
        g[u].eb(v);
        g[v].eb(u);
    }
    fo(i, 1, n, 1) cin >> a[i];
    dfs(1);
    fo(v, 1, n, 1) ++dp[tin[v]], --dp[tout[v] + 1];
    foo(i, 1, timer, 1) dp[i] += dp[i - 1];
    fo(i, 1, n, 1) if (dp[tin[i]] >= a[i]) {
        vector < int > ans;
        for (auto & it : st) {
            if (it.F <= tin[i] && tout[it.S] >= tout[i]) {
                --a[i];
                ans.eb(it.S);
            }
            if (!a[i]) break;
        }
        cout << ans.size() << "\n";
        for (auto & it : ans) cout << it << " ";
        return 0;
    }
    cout << -1;
    return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define F first
#define S second
#define ins insert
#define mp make_pair
#define fo(i, n1, n, x) for(int i = n1; i <= n; i += x)
#define foo(i, n, n1, x) for(int i = n; i >= n1; i -= x)
#define bit __builtin_popcount
#define md (l + ((r - l) / 2))
#define all(x) x.begin(),x.end()
#define ll long long
#define ld long double
#define eb emplace_back
#define ub upper_bound
#define lb lower_bound
#define ios ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define file(s) if (fopen(s".in", "r")) freopen(s".in", "r", stdin), freopen(s".out", "w", stdout)

using namespace std;

const int N = 1e5 + 11, mod = 1e9 + 7;
const int INF1 = 2e9 + 11;
const ll INF2 = 2e18 + 11;
const int base = 500;
const int P = 31;
const int dx[] = {1, -1, 0, 0, 1, 1, -1, -1};
const int dy[] = {0, 0, 1, -1, 1, -1, 1, -1};
const double EPS = 1e-12;
const double PI = acos(-1.0);

int n, m, a[N], ct[N];
bool us[N];
queue < int > q;
vector < int > g[N];
inline void dfs(int v) {
    us[v] = 1;
    ++ct[v];
    if (ct[v] == a[v]) q.push(v);
    for (auto & to : g[v]) if (!us[to]) dfs(to);
}
main() {
    file("queue");
    ios;
    cin >> n >> m;
    fo(i, 1, m, 1) {
        int u, v;
        cin >> u >> v;
        g[u].eb(v);
        g[v].eb(u);
    }
    fo(i, 1, n, 1) {
        cin >> a[i];
        if (!a[i]) q.push(i);
    }
    vector < int > ans;
    while (!q.empty()) {
        int v = q.front();
        q.pop();
        ans.eb(v);
        dfs(v);
    }
    cout << ans.size() << "\n";
    for (auto & it : ans) cout << it << " ";
    return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define F first
#define S second
#define ins insert
#define mp make_pair
#define fo(i, n1, n, x) for(int i = n1; i <= n; i += x)
#define foo(i, n, n1, x) for(int i = n; i >= n1; i -= x)
#define bit __builtin_popcount
#define md (l + ((r - l) / 2))
#define all(x) x.begin(),x.end()
#define ll long long
#define ld long double
#define eb emplace_back
#define ub upper_bound
#define lb lower_bound
#define ios ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define file(s) if (fopen(s".in", "r")) freopen(s".in", "r", stdin), freopen(s".out", "w", stdout)

using namespace std;

const int N = 1e5 + 11, mod = 1e9 + 7;
const int INF1 = 2e9 + 11;
const ll INF2 = 2e18 + 11;
const int base = 500;
const int P = 31;
const int dx[] = {1, -1, 0, 0, 1, 1, -1, -1};
const int dy[] = {0, 0, 1, -1, 1, -1, 1, -1};
const double EPS = 1e-12;
const double PI = acos(-1.0);

int n, m, a[N], ct[N];
bool us[N];
vector < int > g[N];
inline void dfs(int v) {
    us[v] = 1;
    ++ct[v];
    for (auto & to : g[v]) {
        if (!us[to]) dfs(to);
    }
}
main() {
    file("queue");
    ios;
    cin >> n >> m;
    fo(i, 1, m, 1) {
        int u, v;
        cin >> u >> v;
        g[u].eb(v);
        g[v].eb(u);
    }
    fo(i, 1, n, 1) cin >> a[i];
    vector < int > ans;
    while (1) {
        bool t = 0;
        fo(i, 1, n, 1) {
            if (a[i] == ct[i]) {
                t = 1;
                ans.eb(i);
                dfs(i);
            }
        }
        if (!t) break;
    }
    cout << ans.size() << "\n";
    for (auto & it : ans) cout << it << " ";
    return 0;
}