#include <bits/stdc++.h>
#pragma GCC optimize("O3")

#define fi first
#define se second
#define em emplace
#define eb emplace_back
#define mp make_pair
#define pi pair<int,int>
#define vi vector<int>
#define vpi vector<pair<int,int>>
#define vll vector<ll>
#define vpll vector<pair<ll,ll>>
#define endl '\n'

#define si(v) int(v.size())
#define all(v) v.begin(), v.end()
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define rep2(i, n, m) for (ll i = n; i <= (m); ++i)
#define rep3(i, n, m) for (ll i = n; i >= (m); --i)

template<class T, class U> bool chmax(T &a, U b) { if (a < b) a = b; return true; }
template<class T, class U> bool chmin(T &a, U b) { if (b < a) a = b; return true; }

using ll = long long;
using ld = long double;
using namespace std;

constexpr ll MOD = 1000000007, MAX = 55555;

vi prime() 
{
  vi ret;

  rep2(i, 3, MAX) {
    bool ok = true;
    rep2(j, 2, sqrt(i)) {
      if (i % j == 0) {
        ok = false;
        break;
      }
    }

    if (ok && i % 10 == 1) ret.eb(i);
  }
  return ret;
}

signed main()
{
  cout << fixed << setprecision(20);
  ios::sync_with_stdio(false);
  cin.tie(0);
  
  int n; cin >> n;
  auto v = prime();

  rep(i, n) {
    if (i) cout << " ";
    cout << v[i];
  }
  cout << endl;
  
  return (0);
}
#include<bits/stdc++.h>
#define Rint register int
using namespace std;
const int N = 300003, mod = 1e9 + 7, ch[8][2] = {{3, 1}, {5, 2}, {2, 2}, {4, 7}, {3, 3}, {6, 1}, {5, 5}, {3, 1}};
char str[N];
int n, dp[N][8];
inline void qmo(int &x){x += (x >> 31) & mod;}
int main(){
    scanf("%s", str); n = strlen(str); dp[n][1] = dp[n][2] = 1;
    for(Rint i = n - 1;~i;-- i)
        for(Rint j = 0;j < 8;++ j){
            if(str[i] != '0') dp[i][j] = dp[i + 1][ch[j][1]];
            if(str[i] != '1') qmo(dp[i][j] += dp[i + 1][ch[j][0]] - mod);
        }
    printf("%d\n", dp[0][0]);
}