#include <bits/stdc++.h>
using namespace std;
int n, m;
vector<int> g[100000];
int z[100000];
vector<int> ans;
bool vis[100000] = {};
bool flag2 = false;
void dfs(int v, int p) {
  ans.push_back(v);
  vis[v] = true;
  z[v] ^= 1;
  for (int i = 0; i < (int)(g[v].size()); i++)
    if (!vis[g[v][i]]) {
      dfs(g[v][i], v);
      ans.push_back(v);
      z[v] ^= 1;
    }
  if (z[v] == 1) {
    if (p == -1)
      flag2 = true;
    else {
      ans.push_back(p);
      ans.push_back(v);
      z[v] = 0;
      z[p] ^= 1;
    }
  }
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < (int)(m); i++) {
    int x, y;
    scanf("%d%d", &x, &y), --x, --y;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  for (int i = 0; i < (int)(n); i++) scanf("%d", z + i);
  bool flag = true;
  for (int i = 0; i < (int)(n); i++)
    if (z[i] == 1) {
      if (flag)
        dfs(i, -1);
      else {
        cout << -1 << endl;
        return 0;
      }
      if (flag2) {
        if (g[i].empty()) {
          cout << -1 << endl;
          return 0;
        } else {
          ans.push_back(g[i][0]);
          ans.push_back(i);
          ans.push_back(g[i][0]);
        }
      }
      flag = false;
    }
  cout << (int)ans.size() << endl;
  for (int i = 0; i < (int)((int)ans.size()); i++) printf("%d ", ans[i] + 1);
  printf("\n");
  return 0;
}
