#include <bits/stdc++.h>
using namespace std;
long long n, a[300002], dp[300001][19], ans[300001];
vector<pair<long long, long long>> v[300001];
signed main() {
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(false);
  long long t;
  cin >> n >> t;
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
    for (long long j = 0; j < 19; j++) dp[i][j] = n + 1;
  }
  vector<long long> las(19, n + 1);
  vector<long long> ans(n + 1);
  for (long long i = 1; i <= n; i++) {
    long long x, y;
    cin >> x >> y;
    v[x].push_back({y, i});
  }
  for (long long i = n; i >= 1; i--) {
    for (long long j = 0; j < 19; j++) {
      if ((a[i] >> j & 1) == 0 or las[j] == n + 1) continue;
      for (long long k = 0; k < 19; k++) {
        dp[i][k] = min(dp[i][k], dp[las[j]][k]);
      }
    }
    for (long long j = 0; j < 19; j++) {
      if (a[i] >> j & 1) las[j] = dp[i][j] = i;
    }
    for (auto x : v[i]) {
      for (long long j = 0; j < 19; j++) {
        if ((a[x.first] >> j & 1) and dp[i][j] <= x.first) {
          ans[x.second] = 1;
          break;
        }
      }
    }
  }
  for (long long i = 1; i <= t; i++)
    if (ans[i])
      cout << "Shi\n";
    else
      cout << "Fou\n";
}
