#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 7;
const int M = 20;
int n, a[N], q, x, y;
int last[M];
int dp[N][M];
int main() {
  cin >> n >> q;
  for (int i = 0; i < n; i++) cin >> a[i];
  memset(last, -1, sizeof last);
  for (int i = n - 1; i >= 0; i--) {
    fill(dp[i], dp[i] + M, n);
    for (int bit = 0; bit < M; bit++) {
      if ((a[i] >> bit) & 1) {
        if (last[bit] != -1) {
          int idx = last[bit];
          for (int bt = 0; bt < M; bt++)
            dp[i][bt] = min(dp[i][bt], dp[idx][bt]);
        }
        last[bit] = i;
        dp[i][bit] = i;
      }
    }
  }
  while (q--) {
    cin >> x >> y;
    x--, y--;
    bool found = false;
    for (int bit = 0; bit < M; bit++)
      if ((a[y] >> bit) & 1) {
        if (dp[x][bit] <= y) {
          found = true;
          break;
        }
      }
    if (found)
      cout << "Shi" << endl;
    else
      cout << "Fou" << endl;
  }
  return 0;
}
