#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e5 + 10;
int n, q;
int a[maxn], dp[maxn][30], g[30];
int main() {
  scanf("%d%d", &n, &q);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  for (int i = 0; i < 25; i++) {
    g[i] = (a[n] & (1 << i)) ? n : n + 1;
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < 25; j++) {
      dp[i][j] = n + 1;
    }
  }
  for (int i = n - 1; i >= 1; i--) {
    for (int j = 0; j < 25; j++) {
      if (a[i] & (1 << j)) {
        for (int x = 0; x < 25; x++) {
          if ((1 << x) & a[g[j]]) {
            dp[i][x] = min(dp[i][x], g[j]);
          }
        }
        if (g[j] <= n) {
          for (int k = 0; k < 25; k++) {
            dp[i][k] = min(dp[i][k], dp[g[j]][k]);
          }
        }
      }
    }
    for (int j = 0; j < 25; j++) {
      g[j] = (a[i] & (1 << j)) ? i : g[j];
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j <= 1; j++) {
    }
  }
  while (q--) {
    int x, y;
    scanf("%d%d", &x, &y);
    int ans = 0;
    for (int i = 0; i < 25; i++) {
      if (((1 << i) & a[y]) && dp[x][i] <= y) {
        ans = 1;
        break;
      }
    }
    printf("%s\n", ans == 1 ? "Shi" : "Fou");
  }
  return 0;
}
