#include <bits/stdc++.h>
using namespace std;
long long n, q, a[300010], l, r, dp[300010][22], last[22];
bool ans;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> q;
  for (long long i = 0; i < n; i++) cin >> a[i];
  for (long long i = 0; i < n; i++)
    for (long long j = 0; j <= 19; j++) dp[i][j] = n, last[j] = n;
  for (long long i = n - 1; i >= 0; i--) {
    for (long long j = 0; j <= 19; j++) {
      for (long long k = 0; k <= 19; k++) {
        if (a[i] & (1LL << k) && last[k] < n) {
          dp[i][j] = min(dp[i][j], dp[last[k]][j]);
        }
      }
    }
    for (long long k = 0; k <= 19; k++)
      if (a[i] & (1LL << k)) last[k] = i, dp[i][k] = i;
  }
  while (q--) {
    cin >> l >> r;
    l--;
    r--;
    ans = false;
    for (long long i = 0; i <= 19; i++) {
      if (a[r] & (1LL << i)) {
        if (dp[l][i] <= r) ans = true;
      }
    }
    if (ans) {
      cout << "Shi\n";
    } else {
      cout << "Fou\n";
    }
  }
  return 0;
}
