#include <bits/stdc++.h>
using namespace std;
const long long maxN = 1e5 + 7, MOD = 1e9 + 7, INF = 1e9 + 7, N = 1e6 + 17,
                sqr = 75;
long long n, m, x, y;
bool v[maxN], sit[maxN], num[maxN];
vector<long long> a[maxN], ans;
void dfs(int x, int par) {
  ans.push_back(x);
  v[x] = true;
  num[x] = (1 - num[x]);
  for (long long i = 0; i < a[x].size(); i++) {
    if (!v[a[x][i]]) dfs(a[x][i], x);
  }
  if (num[x] != sit[x] && par)
    ans.push_back(par), ans.push_back(x), num[x] = (1 - num[x]),
                                          num[par] = 1 - num[par];
  if (par) ans.push_back(par), num[par] = 1 - num[par];
}
int main() {
  cin >> n >> m;
  for (long long i = 1; i <= m; i++)
    cin >> x >> y, a[x].push_back(y), a[y].push_back(x);
  for (long long i = 1; i <= n; i++) cin >> sit[i];
  for (long long i = 1; i <= n; i++) {
    if (sit[i]) {
      dfs(i, 0);
      if (num[i] != sit[i])
        ans.push_back(a[i][0]), ans.push_back(i), ans.push_back(a[i][0]);
      break;
    }
  }
  for (long long i = 1; i <= n; i++) {
    if (sit[i] && !v[i]) return cout << "-1\n", 0;
  }
  cout << ans.size() << "\n";
  for (long long i = 0; i < ans.size(); i++) cout << ans[i] << " ";
  return cout << "\n", 0;
}
