#include <bits/stdc++.h>
using namespace std;
const int LG = 19;
const int N = 3e5 + 7;
int a[N], go[N][LG], last[LG];
int main() {
  int n, q;
  cin >> n >> q;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < LG; i++) {
    last[i] = n;
    go[n][i] = n;
  }
  for (int i = n - 1; i >= 0; i--) {
    for (int j = 0; j < LG; j++) go[i][j] = n;
    for (int j = 0; j < LG; j++)
      if ((a[i] >> j) & 1) {
        for (int k = 0; k < LG; k++) go[i][k] = min(go[i][k], go[last[j]][k]);
        last[j] = i;
        go[i][j] = i;
      }
  }
  for (int i = 0; i < q; i++) {
    int x, y;
    cin >> x >> y;
    x--, y--;
    bool good = false;
    for (int i = 0; i <= LG; i++) good |= ((a[y] >> i) & 1) && (go[x][i] <= y);
    cout << (good ? "Shi" : "Fou") << '\n';
  }
}
