#include <bits/stdc++.h>
using namespace std;
int n, q;
int a[300005];
int pre[30], dp[300005][20];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> q;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  memset(pre, -1, sizeof(pre));
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 20; j++) {
      if (a[i] & (1 << j)) {
        dp[i][j] = i;
      } else {
        dp[i][j] = -1;
      }
    }
    for (int j = 0; j < 20; j++) {
      if ((a[i] & (1 << j)) && (pre[j] != -1)) {
        for (int k = 0; k < 20; k++) {
          dp[i][k] = max(dp[i][k], dp[pre[j]][k]);
        }
      }
      if (a[i] & (1 << j)) {
        pre[j] = i;
      }
    }
  }
  while (q--) {
    int x, y;
    cin >> x >> y;
    --x;
    --y;
    bool can = false;
    for (int j = 0; j < 20; j++) {
      if ((a[x] & (1 << j)) && dp[y][j] >= x) {
        can = true;
        break;
      }
    }
    cout << (can ? "Shi\n" : "Fou\n");
  }
  return 0;
}
