#include <bits/stdc++.h>
using namespace std;
const int MAXN = 300005;
int n, q, a[MAXN], xi, yi;
vector<pair<int, int> > Q[MAXN];
bool reachable[MAXN];
int d[20][20], s[20];
int main() {
  scanf("%d %d", &n, &q);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  for (int i = 0; i < q; i++) {
    scanf("%d %d", &xi, &yi);
    xi--, yi--;
    Q[xi].push_back(make_pair(yi, i));
  }
  for (int i = 0; i < 20; i++)
    for (int j = 0; j < 20; j++) d[i][j] = n;
  for (int i = n - 1; i >= 0; i--) {
    for (int j = 0; j < 20; j++) d[j][j] = i;
    for (int k = 0; k < 20; k++) s[k] = n;
    for (int j = 0; j < 20; j++)
      if ((a[i] & (1 << j)))
        for (int k = 0; k < 20; k++) {
          s[k] = min(s[k], d[j][k]);
        }
    for (int j = 0; j < 20; j++)
      if ((a[i] & (1 << j)))
        for (int k = 0; k < 20; k++) {
          d[j][k] = s[k];
        }
    for (pair<int, int> qi : Q[i]) {
      for (int j = 0; j < 20; j++)
        if ((a[i] & (1 << j)))
          for (int k = 0; k < 20; k++)
            if ((a[qi.first] & (1 << k))) {
              if (d[j][k] <= qi.first) {
                reachable[qi.second] = true;
              }
            }
    }
  }
  for (int i = 0; i < q; i++) {
    if (reachable[i])
      printf("Shi\n");
    else
      printf("Fou\n");
  }
  return 0;
}
