#include <bits/stdc++.h>
using namespace std;
const long long maxn = 3e5 + 10;
const long long mod = 1e9 + 7;
const long long base = 1e18;
long long dp1[32][32];
long long dp[maxn][32];
long long a[maxn];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  if (fopen("t.inp", "r")) {
    freopen("test.inp", "r", stdin);
    freopen("test.out", "w", stdout);
  }
  for (int i = 0; i <= 30; i++) {
    for (int j = 0; j <= 30; j++) {
      dp1[i][j] = base;
    }
  }
  long long n, q;
  cin >> n >> q;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    for (int j = 0; j <= 30; j++) dp[i][j] = base;
  }
  for (int i = n; i >= 1; i--) {
    for (int j = 0; j <= 30; j++) {
      if (a[i] & (1ll << j)) {
        dp[i][j] = i;
        for (int k = 0; k <= 30; k++) {
          dp[i][k] = min(dp[i][k], dp1[j][k]);
        }
      }
    }
    for (int j = 0; j <= 30; j++) {
      if (a[i] & (1ll << j)) {
        for (int k = 0; k <= 30; k++) {
          dp1[j][k] = min(dp[i][k], dp1[j][k]);
        }
      }
    }
  }
  while (q--) {
    long long x, y;
    cin >> x >> y;
    bool chk = false;
    for (int j = 0; j <= 30; j++) {
      if (a[y] & (1ll << j)) {
        if (dp[x][j] <= y) {
          chk = true;
        }
      }
    }
    if (chk)
      cout << "Shi"
           << "\n";
    else
      cout << "Fou"
           << "\n";
  }
}
