#include <bits/stdc++.h>
using namespace std;
using lli = long long int;
template <typename T>
vector<T> read_vector(int n) {
  vector<T> result(n);
  for (int i = 0; i < n; ++i) cin >> result[i];
  return result;
}
template <typename T>
vector<T> read_vector() {
  int n;
  cin >> n;
  return read_vector<T>(n);
}
template <typename T>
void print_vector_no_size(const vector<T>& v) {
  for (const auto item : v) cout << item << ' ';
  cout << endl;
}
template <typename T>
void print_vector(const vector<T>& v) {
  cout << v.size() << endl;
  print_vector_no_size(v);
}
int rand_int(int from, int to) {
  int m = (to - from + 1);
  return from + (rand() + m) % m;
}
int rand_int(int to) { return rand_int(0, to); }
struct Edge {
  int from;
  int to;
  int cost;
  int idx;
  Edge() {}
  Edge(int f, int t) : Edge(f, t, 1, -1) {}
  Edge(int f, int t, int c, int i) : from(f), to(t), cost(c), idx(i) {}
  inline int next(int v) const { return v ^ from ^ to; }
};
struct Graph {
  Graph() {}
  Graph(const vector<vector<Edge>>& g) : g(g) {}
  Graph(int n, const vector<Edge>& edges, bool unordered = true) : g(n) {
    for (const auto& e : edges) {
      g[e.from].push_back(e);
      if (unordered) {
        g[e.to].push_back(e);
      }
    }
  }
  inline int N() const { return g.size(); }
  vector<vector<Edge>> g;
};
vector<Edge> ReadEdges(int m, bool weighted = false) {
  vector<Edge> edges(m);
  for (int i = 0; i < m; ++i) {
    auto& e = edges[i];
    cin >> e.from >> e.to;
    e.idx = i;
    e.cost = 1;
    --e.from;
    --e.to;
    if (weighted) cin >> e.cost;
  }
  return edges;
}
Graph* ReadGraph(bool unordered = true, bool weighted = false) {
  int n, m;
  cin >> n >> m;
  return new Graph(n, ReadEdges(m, weighted), unordered);
}
int main() {
  ios_base::sync_with_stdio(false);
  auto g = ReadGraph()->g;
  auto forbidden = read_vector<int>(g.size());
  vector<bool> state(g.size());
  vector<lli> sum(g.size());
  queue<int> q;
  for (int i = 0; i < forbidden.size(); ++i)
    if (forbidden[i] == 0) q.push(i);
  int iterations = 0;
  while (!q.empty()) {
    ++iterations;
    if (iterations > 1e6) {
      cout << -1;
      return 0;
    }
    int v = q.front();
    q.pop();
    if (sum[v] != forbidden[v]) continue;
    int k = rand_int(g[v].size() + 1);
    v = (k < g[v].size() ? g[v][k].next(v) : v);
    int delta = (state[v] ? -1 : 1);
    state[v] = !state[v];
    sum[v] += delta;
    if (sum[v] == forbidden[v]) q.push(v);
    for (const auto& e : g[v]) {
      int to = e.next(v);
      sum[to] += delta;
      if (sum[to] == forbidden[to]) q.push(to);
    }
  }
  vector<int> res;
  for (int i = 0; i < state.size(); ++i)
    if (state[i]) res.push_back(i + 1);
  print_vector(res);
  return 0;
}
